Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: special/readonly variables in sh emulation
- X-seq: zsh-workers 16860
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxx
- Subject: Re: special/readonly variables in sh emulation
- Date: Mon, 18 Mar 2002 17:43:53 -0800 (PST)
- In-reply-to: <20020318154119.GA11181@xxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- Sender: schaefer@xxxxxxxxxxxxxxxx
On Mon, 18 Mar 2002, Oliver Kiddle wrote:
> We perhaps ought to rethink the status of any special variables
> in sh emulation mode. Especially those which are autoloaded out of
> places like zsh/parameter. Any ideas on how to solve this?
My suggestion would be simply to disable module autoloading entirely when
in sh emulation mode (and maybe ksh too). A sh/ksh script can't possibly
be expecting a dynamically loaded module, and "compinit" et al. can load
anything they explicitly need.
A slightly less drastic approach might be to disable autoloading only for
non-interactive sh emulation.
On Mon, 18 Mar 2002, Peter Stephenson wrote:
> Another is to shift this sort of parameter into a namespace, as we've
> been planning for a long time. I think Sven had a way of doing this
> simply by allowing dots in parameter names --- it wasn't a fully
> featured namespace implementation, but it might be close enough to allow
> us to go over to that if anybody had the time to write it.
I've fooled around with this a bit. The problem is that you have to allow
the dots only inside ${...}, because lots of things break if $file.ext is
interpreted as ${file.ext} rather than ${file}.ext. This is a little
tricky to acheive, because there'd need to be different typtab[] flags for
lexing inside braces v. outside.
On Mon, 18 Mar 2002, Oliver Kiddle wrote:
> Compound variables could be implemented better by being like
> associative arrays - the parent is a hash table of the elements the
> only difference being the elements can be any type, and the syntax is
> different. This alone wouldn't be hard to add onto the existing
> parameter code.
In fact, I deliberately used full parameter hash tables for the
associative array implementation precisely so they could be extended in
the future to support elements of any type. What's needed is a sensible
reference and assignment syntax.
> Also, am I right that we *need* a=() to assign an empty array?
No; `set -A a' will do it.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author