From: Bart Schaefer <schaefer@brasslantern.com>
To: Peter Stephenson <pws@csr.com>,
zsh-workers@sunsite.dk (Zsh hackers list)
Subject: Re: PATCH: test for trap EXIT fix.
Date: Tue, 2 Oct 2001 16:03:28 +0000 [thread overview]
Message-ID: <1011002160329.ZM24847@candle.brasslantern.com> (raw)
In-Reply-To: <25575.1002036764@csr.com>
On Oct 2, 4:32pm, Peter Stephenson wrote:
}
} Bart Schaefer wrote:
} > I'm having a hard time grokking "top level EXIT trap" in that context,
}
} `Top level' means whatever's on the front of the list of EXIT traps.
Ah. I'd have said
trap 'print top-level' EXIT
fn() {
trap 'print fn-level' EXIT
( trap 'print subshell' EXIT )
}
and in that sense the subshell can't possibly execute the top-level trap.
At the same time, but in another sense, `fn-level' and `subshell' are at
the same "level" there.
} The 4.0 behaviour is that only the explicit exit produces a trap; falling
} off the end of the subshell in `( true )' doesn't. I would guess this is
} wrong and they should be equivalent. That may require more special
} handling.
Hrm.
zagzig% echo $ZSH_VERSION
3.0.8
zagzig% TRAPEXIT() { print exiting }
zagzig% (true)
zagzig% (exit)
exiting
zagzig% fn() { ( true ) ; ( exit ); }
zagzig% fn
zagzig% exit
exiting
--
Bart Schaefer Brass Lantern Enterprises
http://www.well.com/user/barts http://www.brasslantern.com
Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net
next prev parent reply other threads:[~2001-10-02 16:03 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-10-01 12:01 Peter Stephenson
2001-10-01 16:01 ` Bart Schaefer
2001-10-02 10:23 ` Peter Stephenson
2001-10-02 14:19 ` Bart Schaefer
2001-10-02 14:39 ` Peter Stephenson
2001-10-02 15:19 ` Bart Schaefer
2001-10-02 15:32 ` Peter Stephenson
2001-10-02 16:03 ` Bart Schaefer [this message]
2001-10-03 15:18 ` PATCH: (2) " Peter Stephenson
2001-10-03 16:16 ` Bart Schaefer
2001-10-08 8:10 ` Peter Stephenson
2001-10-08 9:56 ` Bart Schaefer
2001-10-08 10:32 ` Peter Stephenson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1011002160329.ZM24847@candle.brasslantern.com \
--to=schaefer@brasslantern.com \
--cc=pws@csr.com \
--cc=zsh-workers@sunsite.dk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).