Remix.run Logo
conradludgate 19 hours ago

> You might wonder: “Won’t the block execute immediately when passed as an argument?” Here’s the key insight: in Rye, code blocks { ... } are values. They don’t evaluate until you explicitly tell them to.

emoII 18 hours ago | parent [-]

You're correct, that is lazy evaluation. The entire article talks about lazy evaluation without mentioning it, which was my point

middayc 17 hours ago | parent [-]

I've been programming in REBOL for decade(s) so this is just how it worked and made sense and we never used term "lazy evaluation", so it not part of my vocabulary when explaining this.

Blocks are not evaluated by default, but they are eagerly evaluated if the function that accepts it decides to do so (if, do, loop) ... I understand lazy evaluation more like something that is meant to be evaluated, but physically only gets evaluated when or if you do need the result, which I'm not sure is entirely the same.