zsh-workers
 help / color / mirror / code / Atom feed
From: Daniel Shahaf <d.s@daniel.shahaf.name>
To: zsh-workers@zsh.org
Subject: Re: [PATCH] 'functions -T' tracing: recurse into anonymous functions.
Date: Sun, 12 Jun 2016 14:29:32 +0000	[thread overview]
Message-ID: <20160612142932.GB10072@tarsus.local2> (raw)
In-Reply-To: <160610210632.ZM10619@torch.brasslantern.com>

Bart Schaefer wrote on Fri, Jun 10, 2016 at 21:06:32 -0700:
> On Jun 10,  5:37pm, Daniel Shahaf wrote:
> }
> }  for this function; the flag tt(-T) does the same, but turns off tracing
> }  on any function called from the present one, unless that function also
> } -has the tt(-t) or tt(-T) flag.  The tt(-u) and tt(-U) flags cause the
> } +has the tt(-t) or tt(-T) flag or is anonymous.  The tt(-u) and tt(-U) flags cause the
> 
> That phrasing is a little hard to follow.  Perhaps something more like:
> 
> ... turns off tracing
> for any named (not anonymous) function called from the present one, unless
> that function also ...
> 
> Note I'm also suggesting changing "turns off tracing on" into "turns off
> tracing for" to reduce the chances of off/on confusion.

Good call.  Will fix before pushing.

> (Further, don't be afraid to reformat paragraphs if lines get long.)
> 

I generally avoid rewrapping paragraphs completely since default diff
tools tend to be line-based and therefore don't render such diffs
readably.

I'll break the long line into two.  (That will leave a short line, similar
to 38155.  I can rewrap the paragraph if a short line is a problem.)

> I've been considering something similar for the zsh/param/private module
> to make caller private variables visible inside anonymous functions, but
> haven't worked out all the necessary stack management.

I've also been considering something similar: I'd like PRINT_EXIT_VALUE
to recurse into anonymous functions.  IIRC the problem I ran into was
that the return value of the last command in the anon func, and of the
anon func itself, were both printed (despite being equal).


      reply	other threads:[~2016-06-12 14:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-10 17:37 Daniel Shahaf
2016-06-11  4:06 ` Bart Schaefer
2016-06-12 14:29   ` Daniel Shahaf [this message]

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=20160612142932.GB10072@tarsus.local2 \
    --to=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).