From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1157 invoked by alias); 22 Nov 2015 19:04:00 -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: 37196 Received: (qmail 14174 invoked from network); 22 Nov 2015 19:03:59 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:date:in-reply-to:comments:references:to:subject :mime-version:content-type; bh=QdWIZLCc5/f0FLbUQY1OEA+yAZg//EicuYgC7O754pU=; b=kSdSWn1+ISpRnO3BhUym3vtrdzQvbm9aGdhb9pZaG9/yjyJD/CpB1dZwVwoSgW66ft QvtraWIJxKtGddi37akJsDfGJtZIxNiMEulxMkIQGXFBg2Xq3aHhE9Ur3MF3RIidLRel qNIo0tzKpIWm2U5miuE+qxtPrNk28sR9NWrSLgWnnB7VhsW0+C24jz3it3GIvUtHW72o VZaXrlGJqWQYRBLEm/WpJNMFakr7A+Lw3Bvt4fncHqvc3DlJJcP5NwvSfqFI6aWjfmER 1sxi/0EAAtHT7oW3YrWVbiktwD7nmP50sygxfsq+OTH76JNG7SeMpK1jMMQ/Jx182OFf 1IPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:message-id:date:in-reply-to:comments :references:to:subject:mime-version:content-type; bh=QdWIZLCc5/f0FLbUQY1OEA+yAZg//EicuYgC7O754pU=; b=FQPITFT0DWVKYmTgv5Z2Xcwo48/xb9sZavtUm9x50QbzMU4paJ4IkOM6fHPEX507ei KmzGQcdU2PMBXLumR0UHE0uQk5xPrPW54ZdtVRtBYT7+ZXmBx6QKI35bDkEvmff4bgE0 WgOEMKzHvKCSK93aGr1gCk1tilrNvQ3T/11XUfRrzGxNVKHHrfN49VNRvhOJHXBrTd3S xxOOWP1SqtZ12DtEEp0Fk547R2io0LqMEe6opgmKyOulc8hHKpmWv0ie4f+Mex4cmuDR eOy8GO/v2Yx3tFRuxxvRYxQpds1saBDglefRXS3yfRzLuX0d1ROJhClkd12bwu5WeYe4 HQGg== X-Gm-Message-State: ALoCoQkbCTNEqCysRh3xkaHQ5XXq/8BUIx4n/3KXyxAFo0faWC07eJm8ycY0mpuO3UIEr5drr287 X-Received: by 10.66.132.105 with SMTP id ot9mr31801260pab.122.1448219038943; Sun, 22 Nov 2015 11:03:58 -0800 (PST) From: Bart Schaefer Message-Id: <151122110406.ZM10741@torch.brasslantern.com> Date: Sun, 22 Nov 2015 11:04:06 -0800 In-Reply-To: <20151122182755.2ad1cb72@ntlworld.com> Comments: In reply to Peter Stephenson "Re: Possibly excessive WARN_CREATE_GLOBAL" (Nov 22, 6:27pm) References: <151122095213.ZM10080@torch.brasslantern.com> <20151122182755.2ad1cb72@ntlworld.com> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-workers@zsh.org Subject: Re: Possibly excessive WARN_CREATE_GLOBAL MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Nov 22, 6:27pm, Peter Stephenson wrote: } Subject: Re: Possibly excessive WARN_CREATE_GLOBAL } } On Sun, 22 Nov 2015 09:52:12 -0800 } Bart Schaefer wrote: } > However, do we want to be complaining about REPLY, reply, match, mbegin, } > mend, MBEGIN, MEND, and BASH_REMATCH? } } Yes, those are exactly the ones where it's important we do --- in fact, } match etc. were in my mind when I introduced the option [...] } } (Unfortunately, in this example we don't actually get a warning for the } inner scope if the outer function had already localised the variable } [...]. You could argue for a warning "variable created in outer } scope", I suppose.) Hmm. No time to fix it now, but declaring something "private" suppresses the warncreateglobal warning without allowing the variable to become set in the inner scope. (What SHOULD happen here? An error?) torch% zmodload zsh/param/private torch% setopt extendedglob warncreateglobal torch% () { local -P match () { [[ abc = (#b)*(?)* ]] typeset -p match mbegin mend } print ${(t)match} } (anon):1: array parameter mbegin created globally in function (anon) (anon):1: array parameter mend created globally in function (anon) (anon):typeset:2: no such variable: match typeset -a mbegin mbegin=( 3 ) typeset -a mend mend=( 3 ) scalar-local-hide-hideval-special