From: Mikael Magnusson <mikachu@gmail.com>
To: Bart Schaefer <schaefer@brasslantern.com>
Cc: Zsh hackers list <zsh-workers@zsh.org>
Subject: Re: "break" and functions
Date: Fri, 29 Mar 2024 22:14:45 +0100 [thread overview]
Message-ID: <CAHYJk3S=FcrbcY+79R1uPC9k7Bv9kH0-CCo6z8b=rot5bpcjjQ@mail.gmail.com> (raw)
In-Reply-To: <CAH+w=7acsf9YYrOeS6GPWSffm4p4=-rU6YONsBAhJg20=S1b7Q@mail.gmail.com>
On Fri, Mar 29, 2024 at 7:51 PM Bart Schaefer <schaefer@brasslantern.com> wrote:
>
[only replying to this last part]
> > In the case of
> > repeat 3 print c*(oe:'break':)
> > it might be a useful feature if break applied to the internal loop over
> > globbed files causing print to run but only with those files that were
> > matched so far.
>
> IIRC the entire glob loop finishes and then any (e) actions are
> applied to the resulting list. So "matched so far" is not well
> defined. I believe the only way to stop the internal loop "early" is
> the (Y) qualifier.
This is not the case, eg
% ls /**/*(e:exit:)
returns instantly, while this doesn't
% ls /**/*(e:true:)
--
Mikael Magnusson
next prev parent reply other threads:[~2024-03-29 21:15 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-29 1:54 Bart Schaefer
2024-03-29 9:30 ` Mikael Magnusson
2024-03-29 16:28 ` Bart Schaefer
2024-03-29 16:56 ` Bart Schaefer
2024-03-29 17:38 ` Oliver Kiddle
2024-03-29 18:51 ` Bart Schaefer
2024-03-29 21:14 ` Mikael Magnusson [this message]
2024-03-29 22:02 ` 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='CAHYJk3S=FcrbcY+79R1uPC9k7Bv9kH0-CCo6z8b=rot5bpcjjQ@mail.gmail.com' \
--to=mikachu@gmail.com \
--cc=schaefer@brasslantern.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).