From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21020 invoked from network); 15 Oct 1999 06:13:19 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 15 Oct 1999 06:13:19 -0000 Received: (qmail 3179 invoked by alias); 15 Oct 1999 06:13:12 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 8265 Received: (qmail 3172 invoked from network); 15 Oct 1999 06:13:11 -0000 Date: Fri, 15 Oct 1999 08:13:08 +0200 (MET DST) Message-Id: <199910150613.IAA16881@beta.informatik.hu-berlin.de> From: Sven Wischnowsky To: zsh-workers@sunsite.auc.dk In-reply-to: "Bart Schaefer"'s message of Thu, 14 Oct 1999 15:07:54 +0000 Subject: Re: PATCH: Re: Associative array ordering and selective unset (Re: Example function) Bart Schaefer wrote: > I almost implemented this a while ago, but I stopped because of this: > > } scanparamvals(HashNode hn, int flags) > } { > } + if (!(prog = patcompile(tmp, 0, NULL)) || !pattry(prog, scanstr)) > } + return; > > It just seemed so unpleasant to recompile the pattern for every key ... Yep, I was a bit worried about this, too. > I should probably clarify what I mean by that. In another post, I wrote: > > map=( > '(*.(gz|Z)) zcat' > '(*.bz2) bzip2 -dc' > '(*.bz) bzip -dc' > '(*) <' > ) > eval 'for i do case $i in' ${(j( $i;; ))map} '$i;; esac done' > > Note that with this trick, all the patterns get compiled once (when the > `case' is parsed) and then we can compare every $i to the "keys" without > recompiling any patterns. I had forgotten this message (and had the `(q)' thing in my todo list and some spare time between holding exams). Anyway, this reminds me that we still haven't tried to store pre-compiled patterns in the execution trees for `case' and `[[ .. = ..]]'... Bye Sven -- Sven Wischnowsky wischnow@informatik.hu-berlin.de