From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20916 invoked from network); 1 Mar 1999 12:33:43 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 1 Mar 1999 12:33:43 -0000 Received: (qmail 21856 invoked by alias); 1 Mar 1999 12:33:00 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 5568 Received: (qmail 21842 invoked from network); 1 Mar 1999 12:32:58 -0000 Date: Mon, 1 Mar 1999 13:32:15 +0100 (MET) Message-Id: <199903011232.NAA14510@beta.informatik.hu-berlin.de> From: Sven Wischnowsky To: zsh-workers@sunsite.auc.dk In-reply-to: "Bart Schaefer"'s message of Sun, 21 Feb 1999 05:10:06 -0800 Subject: Re: Magic associative arrays (and more) 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