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

Re: strange alias effects



Andrej and Sven,

> I doubt that this worked before. Maybe you just didn't use it for some 
> time and changed your file in the meantime? Adding that `if', for
> example?
Oops, you are so right.  I downgraded and found that zsh-3.1.6-dev-21 trips 
over the same thing.  Sorry about this misinformation!

And in fact, I moved the look statement into the if-then-else construct
lately.  I guess I haven't use it then for a while and happened to notice
that it doesn't work anymore after my zsh-upgrade.  Stupid coincidence. :-(

> It was always the case that syntactical constructs like if/the/else
> and loops were parsed completely. So if you do:
[...]
> the whole thing is parsed at once. When it is executed, the alias is
> defined, but in this case the functions are already parsed, too.
[...]
> It isn't special to zsh, either. All shells (have to) behave this way.

Oohhh!  This is not very self-evident.  Maybe that should go into the FAQ?
I split the if-clause in two and now it works.  Thank you!

> P.S.: [[..]] is faster than [..].
Thanks!

Thanks and sorry again!
 Andy.

-- 
 E-Mail: Andy@xxxxxxxxx     URL: http://andy.spiegl.de
 PGP/GPG: see headers
                                o      _     _         _
  --------- __o       __o      /\_   _ \\o  (_)\__/o  (_)
  ------- _`\<,_    _`\<,_    _>(_) (_)/<_    \_| \   _|/' \/
  ------ (_)/ (_)  (_)/ (_)  (_)        (_)   (_)    (_)'  _\o_
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 "Technically, Windows is an operating system, which means that it
  supplies your computer with the basic commands it needs to suddenly,
  with no warning whatsoever, stop operating." - Dave Barry



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