in reply to Re^10: Small Perl 6 discoveries II, Rats
in thread [Perl6] Small discoveries I, __DATA__
One thing's for sure -- you're confused!
Thanks - I think it was just a misunderstanding of what constitutes a "rational object".
I hope I'm correct in asserting that $x is a "rational object" if and only if $x.VAR.^name returns Rat - in which case it is impossible to assign to $x and the value that $x points to and returns cannot change (ie is immutable).
It seems somewhat similar to the perl5 scenario where one assigns $ref = \42;
In such a case the value of $$ref likewise cannot be altered (ie is immutable).
I'm further wondering if it's the case (in perl6) that $x is an immutable object whenever $x.var.^name returns anything other than Scalar ... though faik there could be other exceptions ...
Cheers,
Rob