Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: inconsistency of invalid identifier error messages
- X-seq: zsh-workers 26034
- From: Oliver Kiddle <okiddle@xxxxxxxxxxx>
- To: Zsh workers <zsh-workers@xxxxxxxxxx>
- Subject: Re: inconsistency of invalid identifier error messages
- Date: Wed, 12 Nov 2008 16:53:55 +0100
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.co.uk; h=Received:X-YMail-OSG:X-Yahoo-Newman-Property:Received:In-reply-to:From:References:To:Subject:Date:Message-ID; b=zC/3+seAaY4wGmXTTznnAmliFIntjV6nzZAMDY1vBvcKXFUS1yCEdHQ/J20sletlkYTu1K64s46E4yQ0FEmqvveeUjUCTJTovl/UJqtU3V9wH0E0BMd1WviHg/+J55/VlpTbjiUxJ/GATjK35Vw8o4o9TIPXgRZzmVfY84ID2Ds= ;
- In-reply-to: <20081112141213.6d26470b@news01>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <32190.1226497822@thecus> <20081112141213.6d26470b@news01>
Peter wrote:
> Presumably this is connect to parsing subscripts? unset 'a[b]' is not an
> error if a is an associative array (even if the element b doesn't exist),
> though 'a[b' obviously is.
Yes. For unset 'a[b]' to not be an error is entirely consistent with
unset b not being an error when there is no b variable.
What I think should change is that unset 'a-b' should produce an error.
> > invalid parameter name: a-b
>
> I think this one is probably clearest. ("Parameter" isn't a very good word
> for a variable, but that's too widespread to do anything about.)
>
We've also got:
% vared not-here
vared: no such variable: not-here
I actually think there would be some sense to trying to use variable for
the documentation and error messages even if the internals and some
things like the zsh/parameter module can't be changed. Similarly the
documentation could prefer declare to typeset.
> Hmmm... "-" *is* an identifier if $- is a parameter. Maybe the test
Exactly. So the ideal error message would be one complaining that `-' is
readonly.
Oliver
Messages sorted by:
Reverse Date,
Date,
Thread,
Author