zsh-workers
 help / color / mirror / code / Atom feed
* Magic associative arrays
@ 1999-02-21 13:10 Bart Schaefer
  1999-02-22 10:51 ` Bruce Stephens
  0 siblings, 1 reply; 2+ messages in thread
From: Bart Schaefer @ 1999-02-21 13:10 UTC (permalink / raw)
  To: zsh-workers

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Magic associative arrays
  1999-02-21 13:10 Magic associative arrays Bart Schaefer
@ 1999-02-22 10:51 ` Bruce Stephens
  0 siblings, 0 replies; 2+ messages in thread
From: Bruce Stephens @ 1999-02-22 10:51 UTC (permalink / raw)
  To: zsh-workers

"Bart Schaefer" <schaefer@brasslantern.com> writes:

> 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() ...

And, of course, the Perl mapping to db files (presuming that configure
notices some compatible db library).


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1999-02-22 10:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-02-21 13:10 Magic associative arrays Bart Schaefer
1999-02-22 10:51 ` Bruce Stephens

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).