From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3078 invoked from network); 6 Oct 2002 17:04:13 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 6 Oct 2002 17:04:13 -0000 Received: (qmail 24489 invoked by alias); 6 Oct 2002 17:04:05 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 17779 Received: (qmail 24470 invoked from network); 6 Oct 2002 17:04:04 -0000 Date: Sun, 6 Oct 2002 13:03:53 -0400 From: Clint Adams To: Bart Schaefer Cc: Zsh workers Subject: Re: db module Message-ID: <20021006170353.GA531@dman.com> References: <20021006053229.GA14350@dman.com> <20021006122451.GV24160@malachi.theoscape.net> <1021006164658.ZM11928@candle.brasslantern.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1021006164658.ZM11928@candle.brasslantern.com> User-Agent: Mutt/1.4i X-Virus-Scanned: by amavisd-milter (http://amavis.org/) > It would seem to me that all of this stuff can be accomplished by the > equivalent of ksh discipline functions (plus, in the DB case, a module > to do the actual database access). Rather than implementing each of > these things as different typeset variants, we should work on adding > discipline functions. So, if I grasp the concept correctly, one could do something like db.get() { .sh.value=$(db_get thisdb "$.sh.subscript"); } print $db[key] > (Was it Andrej who's working on a parameter code rewerite?) Oliver, I thought. Maybe both of them. > You mean "print $twice[2]", yes? Yes. > On Oct 6, 8:24am, Hans Dieter Pearcey wrote: > } Subject: Re: db module > } > } However, if the function got an extra argument when an element was > } assigned to, it could be pretty neat, e.g.: > } > } f() { [ "$2" ] && echo $2 > $1; cat $1 } > > I confess to having no idea what that's supposed to mean. I think he's trying to say that var[5]=xyz would call $(f 5 xyz). Only I don't know what the cat's about. Using var.set() would seem much cleaner.