From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24447 invoked by alias); 9 Feb 2015 14:10:34 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 34483 Received: (qmail 896 invoked from network); 9 Feb 2015 14:10:33 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 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= X-Sasl-enc: 7mk2vyCAlMElFglfYzrGwAw1ddKQORjd61cq0S0wjjxf 1423491031 Date: Mon, 9 Feb 2015 14:10:26 +0000 From: Daniel Shahaf To: Peter Stephenson Cc: Micah Waddoups , zsh-workers@zsh.org Subject: Re: BUG: $_ empty on null function call Message-ID: <20150209141026.GB1833@tarsus.local2> References: <54D89C52.6050702@askmicah.net> <20150209122042.35b74995@pwslap01u.europe.root.pri> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150209122042.35b74995@pwslap01u.europe.root.pri> User-Agent: Mutt/1.5.21 (2010-09-15) Peter Stephenson wrote on Mon, Feb 09, 2015 at 12:20:42 +0000: > On Mon, 9 Feb 2015 03:38:58 -0800 > Micah Waddoups 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