# New Ticket Created by  "Carl Mäsak" 
# Please include the string:  [perl #65900]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=65900 >


<masak> rakudo: my ($a is readonly) = 5; say $a; $a = 42; say $a
<p6eval> rakudo 79d0b9: OUTPUT«5␤42␤»
<PerlJam> heh
* masak submits rakudobug
<masak> which behaviour do I expect? is the 5 assignment allowed?
<masak> probably not, right?
<TimToady> allowed
<masak> ok.
<TimToady> assignment semantic analyzer always has to look at left
side to see if a declarator governs semantics
<PerlJam> surely the assignment must be allowed.  How do you get a
value otherwise?
<masak> PerlJam: my ($a is readonly = 5)
<TimToady> (my $a is readonly) = 5 would not be allowed
<TimToady> well, probably not
<masak> ok, so _not_ allowed... :)
<PerlJam> masak: well, there's 3 different initialization forms we
just talked about. Which are you referring to?  :)
<TimToady> only my form is disallowed
<TimToady> er
<TimToady> the form I said
<PerlJam> heh
<masak> PerlJam: the one TimToady just disallowed.
<TimToady> it's like difference between state $x = 0 and (state $x) = 0
<masak> everything you say will be used against you in the bug report :)
<PerlJam> my ($a is readonly, $b is readonly = 5) = 6;   # does this work?
<PerlJam> ($a = 6 and $b = 5)
<masak> PerlJam: not if the '(my $a is readonly) = 5' doesn't work.
<masak> PerlJam: seems like the same situation with your $a.
<TimToady> no, it's not
<masak> :)
<TimToady> the my is outside
<TimToady> (my vs my (
<masak> oh!
<masak> I missed that!
<masak> important distinction...
<TimToady> I've been saying nothing else for a month
* PerlJam gets masak some TimToady specs
<TimToady> well, a minute, anyway
<masak> sorry, I should pay more attention... :P
<masak> oh, ok. I see now.
<masak> there's no way I can explain this in the bug report save for
quoting the whole thing, misunderstanding and all. :)
<TimToady> consider it an exercise in integrity :)
* masak does that
<masak> rakudo: (my $a is readonly) = 5; say $a
<p6eval> rakudo 79d0b9: OUTPUT«5␤»

Reply via email to