From: Jean Chalard <jean.chalard@gmail.com>
To: zzapper <david@tvis.co.uk>
Cc: zsh-users@sunsite.dk
Subject: Re: duplicating functions
Date: Thu, 20 Oct 2005 20:59:14 +0900 [thread overview]
Message-ID: <fb6be96e0510200459l327b277fv3420d24be697f31@mail.gmail.com> (raw)
In-Reply-To: <kqoel1ltvbmfqr9jg46tkj2p1gh9b9t6io@4ax.com>
> I have a series of functions defined .zshenv
>
> function g0() { gmark $0 $* }
> function g1() { gmark $0 $* }
> function g2() { gmark $0 $* }
> function g3() { gmark $0 $* }
> function g4() { gmark $0 $* }
> function g5() { gmark $0 $* }
> function g6() { gmark $0 $* }
> function g7() { gmark $0 $* }
> function g8() { gmark $0 $* }
> function g9() { gmark $0 $* }
>
> Where gmark contains the code and $0 is used to determine which original
> function was called
>
> Is there are simpler way of doing this
What about the following :
for i in g{0..9}; do function $i() { gmark $0 $* }; done
--
J
"If you wish to leave a record of your call,
please state your messij at the sound of the tone."
next prev parent reply other threads:[~2005-10-20 11:59 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-10-20 9:35 zzapper
2005-10-20 11:59 ` Jean Chalard [this message]
2005-10-20 12:05 ` zzapper
2005-10-20 14:33 ` Bart Schaefer
2005-10-20 16:13 ` Andrey Borzenkov
2005-10-21 8:35 ` zzapper
2005-10-21 14:48 ` Speedy directory generation Meino Christian Cramer
2005-10-21 14:52 ` Peter Stephenson
2005-10-21 15:14 ` Meino Christian Cramer
[not found] ` <20051021145708.GV4387@wu.physik.uni-dortmund.de>
2005-10-21 15:18 ` Meino Christian Cramer
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=fb6be96e0510200459l327b277fv3420d24be697f31@mail.gmail.com \
--to=jean.chalard@gmail.com \
--cc=david@tvis.co.uk \
--cc=zsh-users@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).