On Tue, Feb 15, 2005 at 09:34:31PM -0600, Patrick R. Michaud wrote:
> On Tue, Feb 15, 2005 at 07:20:53PM -0600, Jonathan Scott Duff wrote:
> > > Patrick R. Michaud wrote:
> > > >OTOH, what happens with...?
> > > >
> > > >   sub nofun($x is rw) {
> > > >       $x += 2;
> > > >   }
> > > >
> > > >   $y = 3 | 4;
> > > >   nofun($y);
> > 
> > That's either an error ("Can't modify constant") or the same as 5|6.
> > The former makes the most sense to me at the moment.
> 
> Hmm.  $y is definitely not constant -- that's how I was able to do
> the assignment in the first place.  And "is rw" certainly doesn't
> sound like "constant" to me.  :-)  

No, no, I was thinking that $y is composed of constants 3 and 4. The
autothreading happens such that the call to nofun() is the same as if
you'd written:

        3 += 2; 4 += 2;

which are attempts to modify those constants.  This is assuming that
the Any type is inconsistent with the Junction type; otherwise it's
just the same as
        
        $y += 2;

which should certainly yield 5|6

        $y += 2                         ->
        $y = $y + 2                     ->
        $y = (3 + 2)|(4 +2)             ->
        $y = 5|6


-Scott
-- 
Jonathan Scott Duff
[EMAIL PROTECTED]

Reply via email to