3 ms·
Yes, but I meant it in the most abstract, conceptual sense. There is no easy way to replace short-circuit operators in an eager-evaluation language but it can s
by jcarrano 2y ago
Yes, but I meant it in the most abstract, conceptual sense. There is no easy way to replace short-circuit operators in an eager-evaluation language but it can still be done. E.g. "(a() || b())" could be replaced by "or(a, b)", which is quite challenging to do in C, though possible in C++, Python, and other languages which have closures:
def or(a, b):
r = a()
if not r:
r = b()
return r