zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: Sebastian Gniazdowski <sgniazdowski@gmail.com>
Cc: Zsh hackers list <zsh-workers@zsh.org>
Subject: Re: Can this snippet be further improved?
Date: Fri, 28 Jul 2023 14:37:50 -0700	[thread overview]
Message-ID: <CAH+w=7bvvZ4CPYqumCg5qbFXSRa+svnsAn2rJtZqw7jvZCMOcA@mail.gmail.com> (raw)
In-Reply-To: <CAKc7PVD_cJ15tdkaK60yEo_T9nMK34X12vqNEg8_gAMxNNPeCA@mail.gmail.com>

On Fri, Jul 28, 2023 at 3:07 AM Sebastian Gniazdowski
<sgniazdowski@gmail.com> wrote:
>
> For example, would be :P instead of :A better?
>
> On Fri, 28 Jul 2023 at 09:53, Sebastian Gniazdowski
> <sgniazdowski@gmail.com> wrote:
> >
> >     0=${${ZERO:-${(%):-%x}}:A}

What is $ZERO ?  (I'm not very familiar with the "zsh plugin standard" here.)

Is there a reason not to use ${funcstack[1]} instead of ${(%):-%x} ?
I presume you're assigning 0= at top level of the plugin, otherwise %x
is going to be the file where the function is defined rather than the
file where the function is being executed and further you'd mess up
FUNCTIONARGZERO et al.  I suppose %x doesn't require zsh/parameter, is
that really an issue?

As to :A vs. :P, it almost seems like :a:P would be preferable to
either of those ... :A is described as ":a followed by realpath()
except where there is no realpath(3)" whereas :P is "LIKE realpath()"
but doesn't actually require realpath(3).


  reply	other threads:[~2023-07-28 21:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-28 14:53 Sebastian Gniazdowski
2023-07-28 15:06 ` Sebastian Gniazdowski
2023-07-28 21:37   ` Bart Schaefer [this message]
2023-07-29  3:09     ` Sebastian Gniazdowski
2023-07-28 22:17       ` 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='CAH+w=7bvvZ4CPYqumCg5qbFXSRa+svnsAn2rJtZqw7jvZCMOcA@mail.gmail.com' \
    --to=schaefer@brasslantern.com \
    --cc=sgniazdowski@gmail.com \
    --cc=zsh-workers@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).