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

Re: PATCH: 4.1: multi-parameter for loop



On Wed, Jun 20, 2001 at 08:12:09PM +0100, Peter Stephenson wrote:

> "Bart Schaefer" wrote:
> > Well, there's this:
> > 
> > 	for in in in in; do echo $in; done
> 
> It will stop reading parameters when it reaches the second `in'.  I meant
> to document this, although it should be pretty obvious.

Right.  That lacks ambiguity because multiple distinct parameters can't
have the same name.  But that ambiguity is missing in

    for i in in in; do ....

Do you set $i to "in" and "in" or do you set $i and $in set to "in" and ""?
Posix presumably would simply use the first interpretation, and if you want
something like the second, just don't use a parameter named in?  Or am I
missing the disambiguation?

Danek



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