News for hackers. Stuff that matters.
Re:Named Booleans prevent C++ bugs and save you time by yunruse on Saturday February 18, 2023 @09:32AM (#34847191)
I was curious about the concept of inverting this – requiring that all variables lazily evaluate, and in the case that evaluation is needed now, some keyword obtains it. But when I think about it, that's sort of just `await`.

I'm curious as to if it's feasible to syncretise these two aspects of variable evaluation into a shared feature that makes async and sync code feel alike.

Re:Named Booleans prevent C++ bugs and save you time by cesarb on Saturday February 18, 2023 @09:49AM (#34847288)
> I was curious about the concept of inverting this – requiring that all variables lazily evaluate, and in the case that evaluation is needed now, some keyword obtains it.

That's how Haskell works. Everything is lazily evaluated, and in the case that evaluation is needed now, the "seq" function obtains it (https://wiki.haskell.org/Seq).

Re:Named Booleans prevent C++ bugs and save you time by jeremyjh on Saturday February 18, 2023 @10:39AM (#34847651)
It’s called lazy evaluation but it isn’t really anything like await. Await blocks on a computation that is already running; it doesn’t begin evaluation only when you await it.