Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Magic associative arrays (and more)
- X-seq: zsh-workers 5568
- From: Sven Wischnowsky <wischnow@xxxxxxxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxxxxxx
- Subject: Re: Magic associative arrays (and more)
- Date: Mon, 1 Mar 1999 13:32:15 +0100 (MET)
- In-reply-to: "Bart Schaefer"'s message of Sun, 21 Feb 1999 05:10:06 -0800
- Mailing-list: contact zsh-workers-help@xxxxxxxxxxxxxx; run by ezmlm
Bart Schaefer wrote:
> There are a whole lot of fun things we could do with special associative
> array paramters. Examples:
>
> An AA named "functions" that looks up values in the shell function hash
> table. `functions foo` would be the same as `print $functions[foo]`. The
> "functions" AA could be read-only, but perhaps it would be fun to be able
> to edit the function with `noglob vared functions[foo]`?
Looking at some of the completion example function makes this look
interesting, too, e.g.:
- being able to test for the existance of a function with
`${+functions[foo]}' would allow us to conditionally call the
`_match_*' functions
- having `$commands[foo]' give the path of `foo' would allow us to
remove the `$(whence -p ...)' in `_normal'
- with `${(k)parameters}' we could get rid of that horrible
expression in `_brace_params' (is there really no easier way
currently?)
Bye
Sven
--
Sven Wischnowsky wischnow@xxxxxxxxxxxxxxxxxxxxxxx
Messages sorted by:
Reverse Date,
Date,
Thread,
Author