Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: PM_TAGGED and PM_TAGGED_LOCAL being set simultaneously (functions -T -t f)
- X-seq: zsh-workers 48575
- From: Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
- To: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>, zsh-workers@xxxxxxx
- Subject: Re: PM_TAGGED and PM_TAGGED_LOCAL being set simultaneously (functions -T -t f)
- Date: Wed, 14 Apr 2021 16:22:56 +0100 (BST)
- Archived-at: <https://zsh.org/workers/48575>
- Importance: Medium
- In-reply-to: <20210414150337.GA23748@tarpaulin.shahaf.local2>
- List-id: <zsh-workers.zsh.org>
- References: <20210414150337.GA23748@tarpaulin.shahaf.local2>
> On 14 April 2021 at 16:03 Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx> wrote:
> As y'all recall, «functions -T» and «-t» set the XTRACE option for calls
> to the named function.
>
> With that in mind, in the following code:
>
> [[[
> f() g
> g() :
> functions -T f
> functions -t f
> f
> ]]]
>
> Should XTRACE be on or off when g is run? Or should an error be raised
> before g is called?
>
> And if -t were set first and -T second?
The way the documentation is written:
The flag -t turns on execution tracing for this function;
the flag -T does the same, but turns off tracing for any named (not
anonymous) function called from the present one, unless that func‐
tion also has the -t or -T flag.
makes it sound as if turning off for called functions is more powerful behaviour,
in which case -T should always be used if specified. But it doesn't actually
*say* that and could be rewritten anyway, so it's not much of a steer. Having
one flag cause another to be ignored is pretty standard behaviour and relatively
straightforward to implement, though.
pws
Messages sorted by:
Reverse Date,
Date,
Thread,
Author