* Re: Magic associative arrays (and more)
@ 1999-03-01 12:32 Sven Wischnowsky
0 siblings, 0 replies; only message in thread
From: Sven Wischnowsky @ 1999-03-01 12:32 UTC (permalink / raw)
To: zsh-workers
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@informatik.hu-berlin.de
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~1999-03-01 12:33 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-03-01 12:32 Magic associative arrays (and more) Sven Wischnowsky
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).