zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.w.stephenson@ntlworld.com>
To: Daniel Shahaf <d.s@daniel.shahaf.name>, zsh-workers@zsh.org
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)	[thread overview]
Message-ID: <994269365.178120.1618413776846@mail2.virginmedia.com> (raw)
In-Reply-To: <20210414150337.GA23748@tarpaulin.shahaf.local2>

> On 14 April 2021 at 16:03 Daniel Shahaf <d.s@daniel.shahaf.name> 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


  reply	other threads:[~2021-04-14 15:23 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-14 15:03 Daniel Shahaf
2021-04-14 15:22 ` Peter Stephenson [this message]
2021-04-15 16:21   ` Daniel Shahaf
2021-04-15 18:38     ` Peter Stephenson
2021-04-15 20:58       ` Daniel Shahaf
2021-05-16 14:50         ` Lawrence Velázquez
2021-05-18  1:57           ` Daniel Shahaf

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=994269365.178120.1618413776846@mail2.virginmedia.com \
    --to=p.w.stephenson@ntlworld.com \
    --cc=d.s@daniel.shahaf.name \
    --cc=zsh-workers@zsh.org \
    /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).