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

Re: zsh funcs



> zefram@xxxxxxxxxxxxxxxxx said:
> > This should be
> 
> > eval $1=\$PWD : ~$1
> 
> > -zefram 
> 
> Thanks, but why is this necessary?  Was the change in behavior intentional?

I would not say that it was intentional.  I always thought that eval is
necessary for that.  In addvars() there is an explicite singsub() call to
substitute the left-hand-side of an assignment which is now only used to
substitute the index of the assignment.  The change was that the lexer
gives the assignment token only if a word of the form number=value or
name=value or name[index]=value appears in command position where name has
only alphanumeric characters and underscores and starts with a letter or an
underscore.  This fixes problems with 1foo=bar assignments.

Zoltan



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