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

"{ } always { }" construct and return in called functions



Hello everyone,

There is something I don't understand with the "{ } always { }" construct.
What is the difference between the two following runs? I would expect the
last run to behave as the first one. What am I missing here?

*% zsh --version*
zsh 5.0.2 (x86_64-pc-linux-gnu)
*% cat test*
#!/bin/zsh

mytrue() { return 0 }
mywrap() { echo BEGIN; $1; echo END }
mytest() { { exit 1 } always { mywrap $1 } }

mytest $1
*% ./test true*
BEGIN
END
*1% ./test mytrue*
BEGIN
*1% *

Since I don't know if I successfully subscribed to the mailing list, please
Cc me to your answer.

Thanks,
ia0


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