Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: BUG: $_ empty on null function call
- X-seq: zsh-workers 34483
 
- From: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
 
- To: Peter Stephenson <p.stephenson@xxxxxxxxxxx>
 
- Subject: Re: BUG: $_ empty on null function call
 
- Date: Mon, 9 Feb 2015 14:10:26 +0000
 
- Cc: Micah Waddoups <micah@xxxxxxxxxxxx>, zsh-workers@xxxxxxx
 
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=	daniel.shahaf.name; h=x-sasl-enc:date:from:to:cc:subject	:message-id:references:mime-version:content-type:in-reply-to; s=	mesmtp; bh=DCp2E4YKxF/s5hdH2r+m1ulChSc=; b=xOpCkQxSDXYf/JjtvQGy7	fGXOBQ0hyjV5pjLxw4Lp3rReyAu0UE7BfF0Vgvde9/ghAHjhG3hXYVtmo8yyfZdJ	6dQ7XJOHiWyedYWnvyOvaE7viTCGZTMsPoxfr2aO6tWAWUX7uREU+qpfCsH+lTcy	THhBYDSIg+CZDELm/81/s8=
 
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=	messagingengine.com; h=x-sasl-enc:date:from:to:cc:subject	:message-id:references:mime-version:content-type:in-reply-to; s=	smtpout; bh=DCp2E4YKxF/s5hdH2r+m1ulChSc=; b=MiILIsAcli0AZ1WsCu1E	/KvGxwhyEEoNK4OwwAFRsfeXKbuH/HLnqEIvmQ5p29oO8eFHUI+r/UVWcCjVJFrf	XF9VuSBxGFEpGnLuJvCbnzeb+e02QPeL7PBRTiMi0MbdA0HEXa4wvtUFtRnzELoV	5koZPTx1kLRSnnLs/9sfnlo=
 
- In-reply-to: <20150209122042.35b74995@pwslap01u.europe.root.pri>
 
- List-help: <mailto:zsh-workers-help@zsh.org>
 
- List-id: Zsh Workers List <zsh-workers.zsh.org>
 
- List-post: <mailto:zsh-workers@zsh.org>
 
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
 
- References: <54D89C52.6050702@askmicah.net> <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@xxxxxxxxxxxx> 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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author