Allison Randal wrote:
> There's an easy way to ensure the clash between method names and
> local variables never happens: always wrap the method name in quotes.
There's a sort-of-related problem with parameter names and local
variable names, but wrapping them in quotes isn't an available
workaround.
For example: it should be possible for a HLL compiler to emit something
like the following:
.sub main :main
foo("bar")
.end
.sub foo
.param string "pmc"
print "pmc"
print "\n"
.end
when compiling code like this (HLL pseudocode):
main() {
foo("bar")
}
foo(pmc) {
print_line(pmc)
}
Perhaps there should be one universal rule: any identifier that comes
from a HLL must always be quoted. But I guess we can't use doublequotes
(or singlequotes), because then PIR can't tell whether the
right-hand-side of
a = "b"
is a string constant or a .param named b.
Perhaps a prefix of "@" would work. That's what dotNET uses to make
identifier names interoperable between HLLs (to avoid clashes with
keywords).
Regards,
Roger Browne