3 ms·
I agree this is weird, but I think it's largely an analogy issue: Ruby and Crystal both explicitly document blocks as not being closures, even when they can be
by woodruffw 2y ago
I agree this is weird, but I think it's largely an analogy issue: Ruby and Crystal both explicitly document blocks as not being closures, even when they can be converted into closures. They're their own weird thing.
Crystal also documents that it will fail if the block contains return or break statements[1].
[1]: https://crystal-lang.org/reference/1.13/syntax_and_semantics/capturing_blocks.html#break-and-next https://crystal-lang.org/reference/1.13/syntax_and_semantics...
- deleted 2y ago[deleted]
- straight-shoota 2y agoI'm a core developer of Crystal. Note that there are two different flavours of blocks in Crystal: inlined and captured ones. `return` and `break` are supported in inlined blocks.