Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [PATCH] declarednull: felipec's approach
- X-seq: zsh-workers 47762
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Felipe Contreras <felipe.contreras@xxxxxxxxx>
- Subject: Re: [PATCH] declarednull: felipec's approach
- Date: Sun, 27 Dec 2020 14:06:15 -0800
- Archived-at: <https://zsh.org/workers/47762>
- Archived-at: <http://www.zsh.org/sympa/arcsearch_id/zsh-workers/2020-12/CAH%2Bw%3D7Yzvqm0aPzeCvHje-s1CZmPj6CE4QBMTkK29QnhDvm_tA%40mail.gmail.com>
- Authentication-results: zsh.org; iprev=pass (mail-oo1-f52.google.com) smtp.remote-ip=209.85.161.52; dkim=pass header.d=brasslantern-com.20150623.gappssmtp.com header.s=20150623 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none
- Cc: "zsh-workers@xxxxxxx" <zsh-workers@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=HRCkgqv7rJRBtqpYooiMt/AHeNFkIjX12Fc9zi8alZc=; b=Wk9mksfBYIDwuwdFs55QGKxVaz//Ths/xkQX7DytAbD6HmX8jfDlTrXAzBFYe+R81s 3qn9Jr8U1aIMb+Mvbh2h9VegK0sfpCveK0pq1GmRI9LV58oTXbtWWmI5P4iZadhd3qrA t2yHa4u5f6mAkFrnpsj7c0Y0EC7IwCHDvDcssyp+auJKqQKP4uMJ4vxs9Y/6oC4WJG7Z X6l1nEQ14kyl6tIpBSoqk2ilJOU8wRbOTMRihiFtGFMB+3/34VclGhkbiF4m8F13JVuQ 1soPZzKECiEcPHl6aGm4qc3Umu5GAyHyb+aOcdGeyMo2LJ2tV3pTYuLRAihV96wme81K zipA==
- In-reply-to: <20201223234711.492603-1-felipe.contreras@gmail.com>
- List-archive: <http://www.zsh.org/sympa/arc/zsh-workers>
- List-help: <mailto:sympa@zsh.org?subject=help>
- List-id: <zsh-workers.zsh.org>
- List-owner: <mailto:zsh-workers-request@zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-subscribe: <mailto:sympa@zsh.org?subject=subscribe%20zsh-workers>
- List-unsubscribe: <mailto:sympa@zsh.org?subject=unsubscribe%20zsh-workers>
- References: <20201223234711.492603-1-felipe.contreras@gmail.com>
- Sender: zsh-workers-request@xxxxxxx
On Wed, Dec 23, 2020 at 3:47 PM Felipe Contreras
<felipe.contreras@xxxxxxxxx> wrote:
>
> I added a test that shows a discrepancy I found (${(t)var}) but there
> could be many, may more. I only checked one instance of PM_UNSET.
Here's one that your patch gets (I think) wrong:
ubuntu% setopt posixbuiltins
ubuntu% () {
function> readonly foo
function> typeset -p foo
function> print x${(t)foo}x
function> }
xx
ubuntu%
(Note "typeset -p" output nothing.) On declarednull without your patch:
ubuntu% setopt posixbuiltins
ubuntu% () {
function> readonly foo
function> typeset -p foo
function> print x${(t)foo}x
function> }
typeset -g -r foo
xx
ubuntu%
The typeset output probably comes down to your third hunk in
Src/params.c (printparamnode), although I'm not certain what the
correct fix is, and I don't know what's up with ${(t)foo}. The
behavior with your patch changes if it's done this way:
ubuntu% () {
function> local foo
function> readonly foo
function> typeset -p foo
function> print x${(t)foo}x
function> }
typeset -r foo
xscalar-local-readonlyx
ubuntu%
More generally, I'm a little concerned by the vunset hunk in
Src/subst.c. When working on declarednull, I tried a LOT of
variations of fiddling with vunset without getting consistent
behavior. I should have preserved them as test cases, but didn't
because the "make check" suite was not passing everything anyway.
Most involved things like ${+array[x]} for arrays and hashes.
One other thing that has me scratching my head about your patch ... I
can't see any reason why it matters that the bit value is (1<<30), but
if I try, for example, overloading (1<<22) as I did for PM_DECLARED,
the argument lists of shell functions stop working.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author