Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: RC_EXPAND_PARAM final patch



On Aug 2,  3:27am, Zoltan Hidvegi wrote:
} Subject: RC_EXPAND_PARAM final patch
}
} There is still one point where the behaviour might be surprising: that's
} when the (e) substitution flag is used:
} 
} % echo ${x}1${(e)^a}2${x}
} x y1a2x y y1b2x y

I get very strange behavior from this.  Vis:

zagzig<25> a=('$[i++]' '$[i++]' '$[i++]')
zagzig<26> i=0
zagzig<27> echo ${^x}1${a}2${^x}
x1$[i++] y1$[i++] z1$[i++] $[i++] $[i++]2x $[i++]2y $[i++]2z

OK so far, but:

zagzig<28> i=0
zagzig<29> echo ${^x}1${(e)a}2${^x}  
x10 y10 z10 $[i++] $[i++]2${^x}

Huh?  Why didn't it evaluate the second ${^x}, which is unquoted and at
the same (re)interpretation level as the first ${^x} ?  I would at least
have expected to get

x10 y10 z10 $[i++] $[i++]2x $[i++]2y $[i++]2z

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com



Messages sorted by: Reverse Date, Date, Thread, Author