From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29122 invoked by alias); 23 Oct 2016 16:47:02 -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: 39713 Received: (qmail 23226 invoked from network); 23 Oct 2016 16:47:02 -0000 X-Qmail-Scanner-Diagnostics: from mail-vk0-f44.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(209.85.213.44):SA:0(0.0/5.0):. Processed in 0.73652 secs); 23 Oct 2016 16:47:02 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: schaefer@brasslantern.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: none (ns1.primenet.com.au: domain at brasslantern.com does not designate permitted sender hosts) 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; bh=LQwGdYzv+BHWcRzidzBuO4WiG2vv4sbJlwe/wf5gEk0=; b=Onq5vLuLKiaYAz83GjumwXsgF0NRXEFBjQRr7P0Oo5sIvWzhQqOSpaS1fC00vWw81h 8gPQWfmDXFEs38WXZrigO+1wcskKmDyCpaPOSpmJpnAAFhw2csepNO01NaIIa+PQzwGT OHwoaOWhceZiIQ0ztG4WzGdysDsmIwM6Za6LShiKBBOQp4ZS0hubnDtBp48ZygG07zaf XE2RNyeEnrcY8vRRCDDEL5HpL8a3YuVMzu+8GCT1NqMyiYsUnxM099vDp5VocqWzUabd GvHu1uydmD4Y8+R9VfPXrmuTGnPjFN2ty40HuaKRT1wA8+rt3mW31uacdG9nCY2/zut6 0CSA== 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; bh=LQwGdYzv+BHWcRzidzBuO4WiG2vv4sbJlwe/wf5gEk0=; b=bGThcPFHpTi1ykRRAe5jfL2s8QxFamLT97u8ASYFZ60fPzYaKCTC3mRo7riFVdwnay RLps9axRyNPzMMAPxDK00v2zAAVYOgfKwdQVqB8fPcDjBvY4xUxZJk9YfyududfHcPTj Md3bWLPjMM5lTDy3mUZS0wNiUCeEmxbSQ/pa3dPB6pEXXCtUoB5i/2lZoKJW+cRpHLzV 0vnRe5KUtVeTWeVnwkIdv/EDXUAwpC8wOQg/yeDEXM3/xeXG5EICyj+9o5hL0uiu3AJT d3UWoG18by+TR0hwr+6xFAXeNYYMczU58NNzHmu48NH1xSi5/XKYS8KrF5m4ahgs9OeF 1e7A== X-Gm-Message-State: ABUngvedPaoHrsVm/6ffyrF9GpmYsvDx8sVk7py3MZsYkgZKGHnWIiJHdYPL8FF3GfRB0Q== X-Received: by 10.31.50.204 with SMTP id y195mr6654618vky.29.1477241212854; Sun, 23 Oct 2016 09:46:52 -0700 (PDT) From: Bart Schaefer Message-Id: <161023094700.ZM3120@torch.brasslantern.com> Date: Sun, 23 Oct 2016 09:47:00 -0700 In-Reply-To: <2047d07f-c5c1-6b8f-3d2d-cfcc2c06b875@inlv.org> Comments: In reply to Martijn Dekker "Re: 'export -p' lacks POSIX output" (Oct 23, 2:00pm) References: <161022112423.ZM6178@torch.brasslantern.com> <2047d07f-c5c1-6b8f-3d2d-cfcc2c06b875@inlv.org> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: Zsh hackers list Subject: Re: 'export -p' lacks POSIX output MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Oct 23, 2:00pm, Martijn Dekker wrote: } Subject: Re: 'export -p' lacks POSIX output } } Op 22-10-16 om 20:24 schreef Bart Schaefer: } > Would anyone object if this just happened all the time, rather than } > depending on POSIXBUILTINS + "export"? } } After the patch, variables with a non-scalar type get output such as: } } export -i10 SHLVL=2 } } Option flags to 'export' other than -p are not POSIX, and POSIX } specifies output without any flags for 'export -p'. We may have to settle for incompatibility here. As I mentioned, there is no way (without either a large code change or introducing yet another global variable [*]) for the code that prints the command name to know whether "typeset -p", "declare -p", "export -p", etc. were used. If the non-string (note, integer is not non-scalar) flags are eliminated, the state won't be properly reflected if the commands are re-input. If you're writing a POSIX-compatible script you shouldn't declare anything integer in the first place, should you? } In any case, if the output needs to be conditional upon POSIXBUILTINS } anyway, I reckon you might as well not change the behaviour at all if } POSIXBUILTINS is not active. The selection of the command name to print and the output of the type dinstinction flags are in separate sections of the code, so that's not really a concern. I think the addition of -g for typeset of non-local parameters in function scope is useful (waiting to hear if anyone has objections) and that doesn't depend on POSIXBUILTINS. [*] Of course if such a variable WERE introduced I could take advantage of it in zsh/param/private. I was trying to avoid invasive changes for that module but if it's needed for other reasons I'd be less shy.