zsh-workers
 help / color / mirror / code / Atom feed
* "break" and functions
@ 2024-03-29  1:54 Bart Schaefer
  2024-03-29  9:30 ` Mikael Magnusson
  2024-03-29 17:38 ` Oliver Kiddle
  0 siblings, 2 replies; 8+ messages in thread
From: Bart Schaefer @ 2024-03-29  1:54 UTC (permalink / raw)
  To: Zsh hackers list

On Wed, Mar 27, 2024 at 3:22 PM Oliver Kiddle <opk@zsh.org> wrote:
>
> Perhaps worth including in a test case is the following which does
> break after running the echo.
>   while :; do; echo ${|REPLY=x;break}; done

When adding this, I ran into a puzzling effect:

% while :; do; echo ${|REPLY=x;break}; done
x
% while :; do; () { echo "$@" } ${|REPLY=x;break}; done
%

That is, breaking the loop skips the function call but does not skip
the builtin.

I think something like this has been mentioned before in different
context, but it's not easy to search for.


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2024-03-29 22:03 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-29  1:54 "break" and functions 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
2024-03-29 22:02       ` Bart Schaefer

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).