Most Perl 6 will look like Perl 5

Raphael Mankin raph at mankin.org.uk
Fri Jan 25 11:37:02 GMT 2008


On Fri, 2008-01-25 at 10:51 +0000, Benjamin Smith wrote:
[snip]
> 
> B) The bit between -> and { is now using the same syntax as for any
> subroutine argument declaration.
> 
> sub something ($t is rw) { $t = 5 }
> my $anon = -> $t is rw { $t = 5 }
> for 0..6 -> $t is rw { $t = 5 }
> 
> Are these fashionable CS ideas or functional programming paradigms?
> (Making things read-only by default sure does sound like functional
> programming to me.)
> 
But does this const-ness attach to the *name* or to the *value*? If the
variable is a structure, will the constness be propagated to everything
accessed indirectly from that name?

In all languages that I have come across, from Algol68, though PL/I, C
and onwards, the constness attaches to the name. The safety that you get
from it is largely illusory as you can still change objects accessed
indirectly from that 'constant' object.

True, the const property is useful for simple values, but for object
structures ....



More information about the london.pm mailing list