Garrett Goebel wrote:
> Just does compile-time typing for $foo? Not inlining the constant?
You can't assume that the value associated with the symbol is
the same each time through the code, so how can it be inlined?
> I was thinking lowercase typed variables couldn't be rebound, because
> they were compile-time optimized... Can they? Or are we back to the
> selective use of yet to be named pragmas?
Binding normally means associating a value with a symbol, so binding
to a different type depends upon whether the type information is
associated with the symbol or the value.
I can't recall what Perl 6 does. I suspect that it allows binding
to change types because binding is supposed to replace messing with
globs.
This code should work, yes?
my int $foo;
... $foo is a tiny little int
{ my $bar; $foo := $bar }
... $foo is a big hulking scalar
Why would sticking "const" on $foo change anything?
- Ken