Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Magic associative arrays
- X-seq: zsh-workers 5454
- From: "Bart Schaefer" <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxxxxxx
- Subject: Magic associative arrays
- Date: Sun, 21 Feb 1999 05:10:06 -0800
- Mailing-list: contact zsh-workers-help@xxxxxxxxxxxxxx; run by ezmlm
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]`?
How about an special AA named "files"? "$files[foo]" would be equivalent
to "$(<foo)". One step further: `noglob vared files[foo]` replaces `zed`
almost entirely (except for the ZLE rebinding bits). OK, maybe that one
is getting a little carried away ... but if the OS supports mmap() ...
Hmm; if only there were a way to cause a module to autoload upon reference
to a parameter that it defines ...
--
Bart Schaefer Brass Lantern Enterprises
http://www.well.com/user/barts http://www.brasslantern.com
Messages sorted by:
Reverse Date,
Date,
Thread,
Author