zsh-workers
 help / color / mirror / code / Atom feed
From: Daniel Shahaf <d.s@daniel.shahaf.name>
To: Peter Stephenson <p.stephenson@samsung.com>
Cc: Micah Waddoups <micah@askmicah.net>, zsh-workers@zsh.org
Subject: Re: BUG: $_ empty on null function call
Date: Mon, 9 Feb 2015 14:10:26 +0000	[thread overview]
Message-ID: <20150209141026.GB1833@tarsus.local2> (raw)
In-Reply-To: <20150209122042.35b74995@pwslap01u.europe.root.pri>

Peter Stephenson wrote on Mon, Feb 09, 2015 at 12:20:42 +0000:
> On Mon, 9 Feb 2015 03:38:58 -0800
> Micah Waddoups <micah@askmicah.net> wrote:
> >    I am still a beginner in developing, or I would tackle this issue 
> > directly myself.  The misbehavior is when the command list has a null 
> > function with parameters, the last-command-last-parameter ($_) built-in 
> > variable goes blank.
> 
> Yes, that's obviously an oversight internally.  $_ simply isn't handled
> on this path.
> 

There are some other differences between anonymous functions, e.g., they
don't honor PRINT_EXIT_VALUE:

    % setopt printexitvalue
    % () false

v.

    % setopt printexitvalue
    % f() false
    % f                                                            
    zsh: exit 1

Engineering-wise, the ideal solution would be for anonymous and named
functions to share code... though I realize that may be a somewhat
invasive code change.

Daniel

> Somebody will get around to it eventually, I imagine...
> 
> pws


  reply	other threads:[~2015-02-09 14:10 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-09 11:38 Micah Waddoups
2015-02-09 11:44 ` Micah Waddoups
2015-02-09 12:20 ` Peter Stephenson
2015-02-09 14:10   ` Daniel Shahaf [this message]
2015-02-09 14:25     ` Peter Stephenson
2015-02-09 15:13       ` Peter Stephenson
2015-02-09 16:11         ` Bart Schaefer
2015-02-10 10:59         ` Daniel Shahaf
2015-02-10 10:54       ` 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=20150209141026.GB1833@tarsus.local2 \
    --to=d.s@daniel.shahaf.name \
    --cc=micah@askmicah.net \
    --cc=p.stephenson@samsung.com \
    --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).