Garrett Goebel wrote:
> worried about the loss of data-hiding with Perl6's lexicals.
> Was that ever resolved?

Here in the 10-step Perl 6 program we don't talk about
resolution. We just learn to cope with change. ;)

There were two issues I had. As a Perl 6 user I felt
uncomfortable that Perl 6 is encouraging people to violate
lexical scoping. The other was that it seemed impossible
to compile any code if a caller at run-time can yank
the lexical carpet out from underneath a sub.

Happily I've learned to cope with both. I think in serious
code people won't do it -- there will probably be pragmas
to disable run-time mucking with lexicals. Same thing for
compilation. Some Perl 6 features just might not work when
compiled to JVM or .Net or native code. (I think Java
Python is proof that this isn't a huge problem in
practice.)

Re-defining constants is a simliar thing and I have
similar reservations. It might make reading programs
harder. It will definitely hurt compilation. The trouble
will be that the compiler can't inline a constant. If
it can't inline the constant, then it won't be able to
do constant folding, dead code elimination and a whole
bunch of other cool stuff.

On the other hand, people live with C's preprocessor
and its #undef/#define of constants. If C programmers
don't mind having different parts of a program compiled
with different values for the same constant, then why
should Perl programmers? ;)

- Ken

Reply via email to