Re: Array variables as formal parameters ???

2009-05-25 Thread TSa
HaloO, John M. Dlugosz wrote: Now back to straightening out my misconceptions about scalars _always_ holding item containers. If $x is bound to an Array, for example, the compiled code can't be doing the indirection innately. So it follows that the method forwarding is a property of the obje

Re: Array variables as formal parameters ???

2009-05-25 Thread TSa
HaloO, John M. Dlugosz wrote: I'm assuming that the container defines what item assignment means. At the very least, it will have the STORE method. But I want to have infix:<=> definable in general without having to make it masquerade as an Item Container. I strongly agree with that. It sh

Re: Array variables as formal parameters ???

2009-05-24 Thread John M. Dlugosz
Henry Baragar Henry.Baragar-at-instantiated.ca |Perl 6| wrote: On May 23, 2009 11:26:16 pm John M. Dlugosz wrote: > From whence did it get its Item container? OK, my brain made a wrong turn some time on Tuesday. Let me review the basics. From S02: |$x| may be bound to any object, includi

Re: Array variables as formal parameters ???

2009-05-24 Thread Henry Baragar
On May 23, 2009 11:26:16 pm John M. Dlugosz wrote: > > From whence did it get its Item container? > > OK, my brain made a wrong turn some time on Tuesday. > > Let me review the basics. > > From S02: > |$x| may be bound to any object, including any object that can be bound > > to any other sigil.

Re: Array variables as formal parameters ???

2009-05-24 Thread John M. Dlugosz
Henry Baragar Henry.Baragar-at-instantiated.ca |Perl 6| wrote: Good question, since Nil does Positional, as evidenced by rakudo: > say Nil ~~ Positional 1 Should report this as a bug? Henry At the very least, it is the most simple test case for Nil. Should be in the tes

Re: Array variables as formal parameters ???

2009-05-24 Thread Henry Baragar
On May 23, 2009 11:31:35 pm John M. Dlugosz wrote: > Henry Baragar Henry.Baragar-at-instantiated.ca |Perl 6| wrote: > >>> > sub f2 (@y) {say @y.WHAT; say +...@y}; f2(Nil); > >>> > >>> Array() > >>> 1 > >> > >> Why doesn't +...@y produce 0, not 1? It's an empty list. > > > > From rakudo: > >

Re: Array variables as formal parameters ???

2009-05-23 Thread John M. Dlugosz
Henry Baragar Henry.Baragar-at-instantiated.ca |Perl 6| wrote: > sub f2 (@y) {say @y.WHAT; say +...@y}; f2(Nil); Array() 1 Why doesn't +...@y produce 0, not 1? It's an empty list. From rakudo: > sub f2 (@y) {say @y[0]}; f2(Nil); Nil() Henry

Re: Array variables as formal parameters ???

2009-05-23 Thread John M. Dlugosz
> From whence did it get its Item container? OK, my brain made a wrong turn some time on Tuesday. Let me review the basics. From S02: |$x| may be bound to any object, including any object that can be bound to any other sigil. Perl variables have two associated types: their "value type" and

Re: Array variables as formal parameters ???

2009-05-23 Thread Henry Baragar
On May 23, 2009 04:19:53 pm John M. Dlugosz wrote: > > @y just means "the argument must do the Positional role", so it's a > > looser constraint than "is Array". Equivalent is more like: > > > >sub f2(Positional $x) { } > > > > Thanks, > > > > Jonathan > > I'm finding a difference in how a Posi

Re: Array variables as formal parameters ???

2009-05-23 Thread John M. Dlugosz
Jonathan Worthington jonathan-at-jnthn.net |Perl 6| wrote: Hi, Little clarification... Henry Baragar wrote: I think that in your "Example 1", that you may be making too making too much of a distinction between "$a" and "@a". That is: sub f2(@y) {...} has exactly the same signature as

Re: Array variables as formal parameters ???

2009-05-23 Thread Henry Baragar
On May 23, 2009 04:10:49 pm John M. Dlugosz wrote: > Henry Baragar Henry.Baragar-at-instantiated.ca |Perl 6| wrote: > > I think that in your "Example 1", that you may be making too making too > > much of a distinction between "$a" and "@a". That is: > > sub f2(@y) {...} > > has exactly the sam

Re: Array variables as formal parameters ???

2009-05-23 Thread John M. Dlugosz
Henry Baragar Henry.Baragar-at-instantiated.ca |Perl 6| wrote: I think that in your "Example 1", that you may be making too making too much of a distinction between "$a" and "@a". That is: sub f2(@y) {...} has exactly the same signature as sub f2($x is Array) {...} In other words, the

Re: Array variables as formal parameters ???

2009-05-23 Thread Henry Baragar
On May 22, 2009 06:55:49 pm John M. Dlugosz wrote: > Please take a look at > . I think that in your "Example 1", that you may be making too making too much of a distinction between "$a" and "@a". That is: sub f2(@y) {...} has exactl

Re: Array variables as formal parameters ???

2009-05-23 Thread Jonathan Worthington
Hi, Little clarification... Henry Baragar wrote: I think that in your "Example 1", that you may be making too making too much of a distinction between "$a" and "@a". That is: sub f2(@y) {...} has exactly the same signature as sub f2($x is Array) {...} In other words, they both take

Array variables as formal parameters ???

2009-05-22 Thread John M. Dlugosz
Please take a look at . I started working through how the detailed behavior of the Capture and passing rules need to work, and I ran into something that startled me. There's no examples in S06 of formal parameters, other than the special