From: Hans Dieter Pearcey <hdp@pobox.com>
To: Zsh workers <zsh-workers@sunsite.dk>
Subject: Re: db module
Date: Sun, 6 Oct 2002 08:24:51 -0400 [thread overview]
Message-ID: <20021006122451.GV24160@malachi.theoscape.net> (raw)
In-Reply-To: <20021006053229.GA14350@dman.com>
On Sun, Oct 06, 2002 at 01:32:29AM -0400, Clint Adams wrote:
> > typeset -A things -S db -f /tmp/newdb
> > typeset string -S mapfile -f /tmp/file
>
> Someone suggested tying assocs to functions, so we could add something
> like
>
> f() { print $(( $1 * 2 )) }
> typeset -A twice -S function -f f
> print $f[2]
>
> I'm not sure that there are any useful applications for this though.
As demonstrated above, I can't see how it's any better than calling f()
directly. 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 }
hdp.
next prev parent reply other threads:[~2002-10-06 12:25 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-09-30 14:39 Oliver Kiddle
2002-10-02 7:37 ` Clint Adams
2002-10-06 5:32 ` Clint Adams
2002-10-06 12:24 ` Hans Dieter Pearcey [this message]
2002-10-06 16:46 ` Bart Schaefer
2002-10-06 17:03 ` Clint Adams
2002-10-06 17:14 ` Bart Schaefer
2002-10-06 17:31 ` Clint Adams
2002-10-06 20:19 ` Bart Schaefer
-- strict thread matches above, loose matches on Subject: below --
2002-10-07 13:58 Oliver Kiddle
2002-09-12 5:19 Clint Adams
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=20021006122451.GV24160@malachi.theoscape.net \
--to=hdp@pobox.com \
--cc=zsh-workers@sunsite.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).