junctions as indicies

2005-04-18 Thread David Christensen
I'm looking in S09, and reading about junctions. It seems to me that if we have a junction $j which we use to index into an array or a hash, it should DWIM and return a junction of the corresponding values. @ar=[1..10]; %hash=(a=1,b=4,c=7); $j=1|2|3; $k=a|c; $u = @ar[$j]; # 2|3|4 $v =

Re: junctions as indicies

2005-04-18 Thread Luke Palmer
David Christensen writes: I'm looking in S09, and reading about junctions. It seems to me that if we have a junction $j which we use to index into an array or a hash, it should DWIM and return a junction of the corresponding values. @ar=[1..10]; %hash=(a=1,b=4,c=7); $j=1|2|3; $k=a|c;

Re: junctions as indicies

2005-04-18 Thread Paul Hodges
--- David Christensen [EMAIL PROTECTED] wrote: I'm looking in S09, and reading about junctions. It seems to me that if we have a junction $j which we use to index into an array or a hash, it should DWIM and return a junction of the corresponding values. @ar=[1..10]; %hash=(a=1,b=4,c=7);

Re: junctions as indicies

2005-04-18 Thread Luke Palmer
Paul Hodges writes: Maybe, but I don't like returning junctures in those cases unless you *explicitly* ask for it. I'd rather the default be the arbitrary lists returned, or whatever fits the context. How about @ar=[a..z]; %hash=(a=1,b=4,c=7); $j=1|2|3; @j = (1,2,3); $k=a|c;

Re: junctions as indicies

2005-04-18 Thread Rod Adams
Paul Hodges wrote: --- David Christensen [EMAIL PROTECTED] wrote: I'm looking in S09, and reading about junctions. It seems to me that if we have a junction $j which we use to index into an array or a hash, it should DWIM and return a junction of the corresponding values. @ar=[1..10];