Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: "break" and functions



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