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

Re: Weird exit caused in a trap DEBUG which sources a file.



On Sun, 3 Aug 2008 07:28:37 -0400
"Rocky Bernstein" <rocky.bernstein@xxxxxxxxx> wrote:
> I do not see why this is semantically complicated when the trap DEBUG
> occurs before the statement it refers to is run.  Can you give a very
> specific example of something you feel is tricky?

You mean that the new return value from a DEBUG trap should skip
everything that would happen until the next trap is run?  That's kind of
what I ended up saying, and that's well-defined.

> David Korn made a mistake and he says so.  Chet Ramey also says he
> changed the behavior because he thought it a mistake too. zsh copied
> the mistake. The only claim I've heard for keeping the mistake is
> compatibility with previous versions of zsh. However right now there
> is no evidence that anyone is making use of this mistake that would
> not be happier if it weren't made.

Well, there's no actual evidence it won't cause the toppling of
governments in small Himalayan kingdoms, either.  We probably won't find
out unless we change the default.  I agree setting DEBUG_BEFORE_CMD is
generally more useful, but you're the only user of the feature I've
heard from at all, and I still don't know if there's anything that makes
it hard to set the feature explicitly, in either direction (and at least
trying to set it in your script is the only way to guarantee the correct
behaviour).

If you're going to produce a working debugger that requires this to be
set then I'll be very tempted to change the default, since a generally
available working debugger is extremely useful.

Any definite views from anyone else are welcome.

-- 
Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
Web page now at http://homepage.ntlworld.com/p.w.stephenson/



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