Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: "break" and functions
- X-seq: zsh-workers 52855
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Cc: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Re: "break" and functions
- Date: Fri, 29 Mar 2024 22:14:45 +0100
- Archived-at: <https://zsh.org/workers/52855>
- In-reply-to: <CAH+w=7acsf9YYrOeS6GPWSffm4p4=-rU6YONsBAhJg20=S1b7Q@mail.gmail.com>
- List-id: <zsh-workers.zsh.org>
- References: <CAH+w=7bb9BKUCvqCb=A-Qw36+HVn-NszP2DfQeXsYmKs-HVWFg@mail.gmail.com> <43539-1711733926.063834@011r.oEGd.QZp_> <CAH+w=7acsf9YYrOeS6GPWSffm4p4=-rU6YONsBAhJg20=S1b7Q@mail.gmail.com>
On Fri, Mar 29, 2024 at 7:51 PM Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> 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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author