From: "Bart Schaefer" <schaefer@candle.brasslantern.com>
To: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>,
zsh-workers@sunsite.auc.dk
Subject: Re: PATCH: Re: Associative array ordering and selective unset (Re: Example function)
Date: Thu, 14 Oct 1999 15:07:54 +0000 [thread overview]
Message-ID: <991014150755.ZM21454@candle.brasslantern.com> (raw)
In-Reply-To: <199910141425.QAA16346@beta.informatik.hu-berlin.de>
On Oct 14, 4:25pm, Sven Wischnowsky wrote:
} Subject: PATCH: Re: Associative array ordering and selective unset (Re: Ex
}
} Bart Schaefer wrote (in 5156, hah!):
}
} > typeset -A map
} > map=('*.(gz|Z)' zcat
} > '*.bz2' 'bzip2 -dc'
} > '*.bz' 'bzip -dc'
} > '*' '<')
} >
} > then ${map[(q)$argv[i]]} returns the value for the first subscript match
} > found, and ${map[(Q)$argv[i]]} returns the array of values for every key
} > that matches the subscript.
}
} This implements that -- but uses the characters `k' and `K' although I
} don't know if this is better.
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 ...
--
Bart Schaefer Brass Lantern Enterprises
http://www.well.com/user/barts http://www.brasslantern.com
next prev parent reply other threads:[~1999-10-14 15:08 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
1999-10-14 14:25 Sven Wischnowsky
1999-10-14 15:07 ` Bart Schaefer [this message]
1999-10-14 16:15 ` Bart Schaefer
1999-10-15 6:13 Sven Wischnowsky
1999-10-18 9:53 Sven Wischnowsky
1999-10-18 11:12 Sven Wischnowsky
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=991014150755.ZM21454@candle.brasslantern.com \
--to=schaefer@candle.brasslantern.com \
--cc=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).