On Mon, 23 Sep 2002, Jonathan Scott Duff wrote:

> On Mon, Sep 23, 2002 at 04:58:55PM -0400, Trey Harris wrote:
> >   for (1,("a","b","c"),3 { ... }
> > 
> > and
> > 
> >   for 1,("a","b","c"),3 { ... }
> > 
> > Now that I've ventured away from DWIMs and more into WIHDTEMs (What In
> > Hell Does This Expression Mean), is the above equivalent to
> > 
> >   for 1,qw(a b c), 3 { ... }
> > 
> > as well?
> 
> I'd expect all 3 to mean exactly the same thing.
> 
> > A final unresolved question.  I take it that the splat operator is a
> > deeply flattening operator.  For instance,
> > 
> >   *[1,[2,[3,4,5]],6]
> > 
> > will be converted into
> > 
> >   [1,2,3,4,5,6]
> 
> What other operator acts recursively in this fashion? None that I know
> of.  If someone wants the recursive behavior, they can redefine the
> operator appropriately.
> 
> Besides, with the ^ operator, you can already express arbitrary
> levels:
> 
>       *[1,[2,[3,4,5]],6]              # 1,[2,[3,4,5]],6
>       ^*[1,[2,[3,4,5]],6]             # 1,2,[3,4,5],6
>       ^^*[1,[2,[3,4,5]],6]            # 1,2,3,4,5,6
>       
> et cetera.  :-)

Y'all have it backwards.

        [1,*[2,[3,4,5]],6]              # [1,2,[3,4,5],6]
        [1,*[2,*[3,4,5]],6]             # [1,2,3,4,5,6]

Flat flattens outwards, not inwards.

Luke

Reply via email to