Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
"return" is an always block
- X-seq: zsh-users 12847
- From: Stephane Chazelas <Stephane_Chazelas@xxxxxxxx>
- To: Zsh Users List <zsh-users@xxxxxxxxxx>
- Subject: "return" is an always block
- Date: Sun, 11 May 2008 17:41:19 +0100
- Mail-followup-to: Zsh Users List <zsh-users@xxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
Hiya,
I noticed that
f() { {} always {return}; echo here }
did output "here", that is, the "return" statement doesn't
return from the function. Is this the intended behavior?
So, if one wants to return from a function without setting the
error condition, is the only way to do something like:
f() {
err=0
{ TRY-BLOCK } always {
if ((TRY_BLOCK_ERROR)) {
err=1
TRY_BLOCK_ERROR=0
}
}
if ((err)) return 1
...
}
--
Stéphane
Messages sorted by:
Reverse Date,
Date,
Thread,
Author