I've committed it as of r11820. Since it parses by tokens, braces
inside of strings are allowed.
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
On Mar 7, 2006, at 11:22 AM, Chip Salzenberg wrote:
Neat: It's backward-compatible and makes macros more useful, so file it
under "improvement" and commit it. Two and a half Qs:
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 <[EMAIL PROTECTED]>