Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: BUG: $_ empty on null function call
- X-seq: zsh-workers 34492
- From: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- To: Peter Stephenson <p.stephenson@xxxxxxxxxxx>
- Subject: Re: BUG: $_ empty on null function call
- Date: Tue, 10 Feb 2015 10:54:14 +0000
- Cc: 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=h29OxWnSeyT0RLhWm1CWe5xO6Hc=; b=RwfM3Gm6BW0MipalACaGS vqm3aujCnoOFsmZZJYHhHiMLLwzn88aai/sgK16a5+9yoHTPHIIWV2NWJlROHgI3 bdYyFotZxz9xaIHaxVUli5M1qhyFtuz9Dt1hfMndrP3Qo9m6IzA8GLTD50RrTmXq jmYhprKK69S8cpOf5K6+XY=
- 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=h29OxWnSeyT0RLhWm1CWe5xO6Hc=; b=iR4DAs6TlS+xH+//SPvl M2xcAiCPK6ZP35SA4XueUMTzB54f4mxDy04E73xk3dvFkjfowtzBN/zqRw5sv4Si HeBHQWb1oKZmm6ZYwZkXSKIVUttTOSyEXQdXjkIkunIcn4YLXuKyglW2RgAX9OnQ 9+p0F2yCpc1zrPC58rqK8Qk=
- In-reply-to: <20150209142507.348fa42a@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> <20150209141026.GB1833@tarsus.local2> <20150209142507.348fa42a@pwslap01u.europe.root.pri>
Peter Stephenson wrote on Mon, Feb 09, 2015 at 14:25:07 +0000:
> On Mon, 9 Feb 2015 14:10:26 +0000
> Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx> wrote:
> > There are some other differences between anonymous functions, e.g., they
> > don't honor PRINT_EXIT_VALUE:
> >
> > 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.
>
> They already do everywhere that doesn't deal with the special argument
> syntax (Micah's problem) or with immediate execution after a definition.
Sorry, I know they have execshfunc() in common. I was trying to suggest
that anonymous functions should start using execcmd(), which named
functions were using, in order to reuse its handling of $_ and
PRINT_EXIT_VALUE.
> I suspect this may have to do with a different path owing to an
> optimisation later in the execution path where we make certain
> assumptions if code is regarded as "simple". This is inevitably a
> maintenance headache and we've had lots of issues there.
>
For what it's worth, "() {} foo bar ; print $_" reproduces Micah's
problem and, both before and after your patch, doesn't go through
execsimple().
Cheers,
Daniel
Messages sorted by:
Reverse Date,
Date,
Thread,
Author