Currently, the following syntax is allowed, and used in examples and code throughout the repository:
.local String foo foo = new String .sym String bar bar = new String
But... this isn't actually enforced. You can do:
.local String foo foo = new Blorp
Basically, anything that isn't one of the basic types is interpreted as "pmc".
After a discussion on #parrot, there are a few options that came up. This is a grab bag, and hopefully a basis for discussion:
1) make
.local String foo
(and .sym) equivalent to:
.local pmc foo foo = new String
2) make
.local String foo
(and .syn) a compile time error: just allow "pmc". [1]
3) Allow an initializer as part of the declaration:
.local string foo = ascii:"foo"
which would be equivalent to
.local string foo foo = ascii:"foo"
4) Have .sym and .local take on different possible syntaxes.
5) eliminate one of .sym or .local
6) avoid using ".local" to mean something different based on context (macro or not)
7) Add ".lexical".... No firm syntax was discussed for this, but something like:
.lexical pmc foo # with optional quotes for hard-to-parse variable names
would be equivalent to todays:
.local pmc foo foo = find_lex -1, "foo"
And give the ability to provide something other than the default "-1" there.
8) add ".global"... Similar to #7.
---- [1] This discussion arose because I was curious if a patch that implemented #2 (and fixed all the resulting errors) would be accepted.