It looks to me like this implementation is safe against "{" and "}" in
strings, right?
(Not a new issue, but since we're on the subject of macros:) If I define a
macro named eg. ".local", does it expand as a macro, i.e. is it recognized
before or after core Parrot keywords? I think the example of Perl keywords
vs. user-defined functions teaches us it's a good idea for macros to win in
case of conflict, for backward compatibility when we introduce new keywords.
--
Chip Salzenberg <ch...@pobox.com>
With regard to clashing, pir specials take precedent over macros. The
complications that could arise from accidental recursion, etc, seems
complex. As for your .local example, you can always use .my or .our
instead.
.macro my(var, type)
.sym pmc .var
.var = new .type
.endm
.sub main
.my(foo, .String)
foo = "hello\n"
print foo
.end