zsh-workers
 help / color / mirror / code / Atom feed
From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-workers@sunsite.auc.dk
Subject: Re: PATCH: Re: Associative array ordering and selective unset (Re: Example function)
Date: Fri, 15 Oct 1999 08:13:08 +0200 (MET DST)	[thread overview]
Message-ID: <199910150613.IAA16881@beta.informatik.hu-berlin.de> (raw)
In-Reply-To: "Bart Schaefer"'s message of Thu, 14 Oct 1999 15:07:54 +0000


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


             reply	other threads:[~1999-10-15  6:13 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-10-15  6:13 Sven Wischnowsky [this message]
  -- strict thread matches above, loose matches on Subject: below --
1999-10-18 11:12 Sven Wischnowsky
1999-10-18  9:53 Sven Wischnowsky
1999-10-14 14:25 Sven Wischnowsky
1999-10-14 15:07 ` Bart Schaefer
1999-10-14 16:15   ` Bart Schaefer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=199910150613.IAA16881@beta.informatik.hu-berlin.de \
    --to=wischnow@informatik.hu-berlin.de \
    --cc=zsh-workers@sunsite.auc.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).