In the description for next at:
https://crystal-lang.org/docs/syntax_and_semantics/next.html
It might be helpful to note that next can take a parameter, which will then be the value of that next statement (the same way return does). This is useful to know when writing a code block for something.reduce{}, for instance, where it's probably important that the code block not return a nil.
Hmm. Is this also true for the break statement?
Hmm. Is this also true for the break statement?
AFAIK yes.
Thanks @drosehn! We've got a specific repo for these issues (see above). Please next time open it there. I just opened an issue referencing this on https://github.com/crystal-lang/crystal-book/issues/97.
Most helpful comment
AFAIK yes.
See https://play.crystal-lang.org/#/r/1yic