Remix.run Logo
emoII a day ago

Interesting that this article makes no mention of eager vs lazy evaluation - isn’t a big reason that if, for etc has to be special forms in an eagerly evaluated language that their arguments need to be lazily evaluated, which of course, deviates from the rule? Also, lazy evaluation is achieved in an eagerly evaluated language as simply wrapping a block of code in a function, which makes lazy evaluation isomorphic with the contents of the article

conradludgate 21 hours ago | parent [-]

> 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 20 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 18 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.