zsh-workers
 help / color / mirror / code / Atom feed
From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-workers@sunsite.auc.dk
Subject: Re: PATCH: suggestion for new condition
Date: Thu, 28 Jan 1999 10:19:44 +0100 (MET)	[thread overview]
Message-ID: <199901280919.KAA00943@beta.informatik.hu-berlin.de> (raw)
In-Reply-To: "Bart Schaefer"'s message of Thu, 28 Jan 1999 00:56:20 -0800


Bart Schaefer wrote (in private mail):

> On Jan 28,  9:00am, Sven Wischnowsky wrote:
> } Subject: Re: PATCH: suggestion for new condition
> }
> } Bart Schaefer wrote:
> } 
> } > OK, cool, now dumb question number two:  Why does ${(t)param} ignore the
> } > setting of the `nounset' option?
> } 
> } I don't understand this question. How should we use the setting of
> } nounset?
> 
> For any of the previously existing variable flags x, ${(x)notset} gives an
> error when `setopt nounset'.  However:
> 
> } I wanted it to be slightly modeled after `$+param' which also 
> } seems to ignore nounset.
> 
> That's a valid answer to the question "why?" but leads to the next question
> "is that how it _should_ work?"
> 
> The only reason to use $+param is to test whether param is set, so it
> would be silly for it to ever generate an error.  The main reason for
> using ${(t)param}, though, is to find out the type of the param.
> 
> You can always ask whether a parameter exists or not.  But if the param
> doesn't exist, its type is not merely empty; it's undefined, just as its
> value is undefined.  I think the reason for `nounset' is to make "not
> defined" different from "empty" (albeit in a rather brutal fashion), so
> I think the `nounset' test should apply.  Consistency, and all that.

Ok, I'm convinced.

Bye
 Sven

--- os/subst.c	Wed Jan 27 13:53:56 1999
+++ Src/subst.c	Thu Jan 28 10:17:08 1999
@@ -1017,11 +1017,11 @@
 		    val = dyncat(val, "-export");
 		if (f & PM_UNIQUE)
 		    val = dyncat(val, "-unique");
+		vunset = 0;
 	    } else
 		val = dupstring("");
 
 	    v = NULL;
-	    vunset = 0;
 	    isarr = 0;
 	}
     }

--
Sven Wischnowsky                         wischnow@informatik.hu-berlin.de


             reply	other threads:[~1999-01-28  9:19 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-01-28  9:19 Sven Wischnowsky [this message]
  -- strict thread matches above, loose matches on Subject: below --
1999-01-27  7:51 Sven Wischnowsky
1999-01-28  6:01 ` Bart Schaefer
1999-01-26 15:47 Sven Wischnowsky
1999-01-26 18:23 ` Bart Schaefer
1999-01-25 10:40 Sven Wischnowsky
1999-01-25 10:57 ` Peter Stephenson
1999-01-25 12:50   ` Andrej Borsenkow

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=199901280919.KAA00943@beta.informatik.hu-berlin.de \
    --to=wischnow@informatik.hu-berlin.de \
    --cc=zsh-workers@sunsite.auc.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).