zsh-users
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: Mikael Magnusson <mikachu@gmail.com>
Cc: Steve Dondley <s@dondley.com>, Zsh Users <zsh-users@zsh.org>
Subject: Re: Suggestions for autogenerating function names to wrap the same code?
Date: Tue, 22 Mar 2022 14:16:12 -0700	[thread overview]
Message-ID: <CAH+w=7ZUotyVPjnWjbv9bLqEaq1O2vrPT9S3afFVdXgzaBeMSA@mail.gmail.com> (raw)
In-Reply-To: <CAHYJk3SmArMWCX9B4yVEDOeQTNPw5CkP8H-MD_mT0qzF6P91nQ@mail.gmail.com>

On Tue, Mar 22, 2022 at 2:06 PM Mikael Magnusson <mikachu@gmail.com> wrote:
>
> so if you can get all the function names in an array, you could just say:
> task_func_names=( $(script to pull names out) )
> function $task_func_names() {
>   task_wrapper.pl $funcstack[1] "$@"
> }

When using the "function" keyword, you don't need the empty parens,
either.  That keyword further ignores the state of the MULTI_FUNC_DEF
option, which is what you want if you're using this array method.


  parent reply	other threads:[~2022-03-22 21:45 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-22 20:52 Steve Dondley
2022-03-22 21:03 ` Peter Stephenson
2022-03-22 21:03 ` Mikael Magnusson
2022-03-22 21:09   ` Steve Dondley
2022-03-22 23:37     ` Steve Dondley
2022-03-22 21:16   ` Bart Schaefer [this message]
2022-03-22 23:28   ` Steve Dondley
2022-03-22 23:44     ` Steve Dondley

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='CAH+w=7ZUotyVPjnWjbv9bLqEaq1O2vrPT9S3afFVdXgzaBeMSA@mail.gmail.com' \
    --to=schaefer@brasslantern.com \
    --cc=mikachu@gmail.com \
    --cc=s@dondley.com \
    --cc=zsh-users@zsh.org \
    /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).