Q: Should Op names be allowed to be identifiers.

0 views
Skip to first unread message

Klaas-Jan Stol

unread,
Mar 9, 2007, 6:49:11 AM3/9/07
to Perl 6 Internals
hi,

In PIR, it's allowed to use ops as names for variables. For instance,
it's allowed to write:

.sub main
.local pmc inc
.end

However, when trying to increment your variable 'inc', you could write

.sub main
.local pmc inc
inc inc
.end

which not only looks strange, but will not even compile. The error
message is:

error:imcc:syntax error, unexpected VAR, expecting '('
in file 'kw.pir' line 6

This issue was discussed in ticket 37148 ([TODO] IMCC -improve error
messages)

Now, wouldn't it be a good idea to disallow the use of opnames as
identifiers altogether?
(although having your own custom ops with dyn. op. libs around may be a
problem)

kjs

Reply all
Reply to author
Forward
0 new messages