You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 3, 2020. It is now read-only.
This is less of a problem now because we don't have functions yet (#16), but this is a very important property of booleans that should be properly implemented sooner rather than later.
The problem is that boolean operators are implemented as regular functions (like stdout.print, etc.). They just have "internal-only" names which are only callable from inside the compiler. This solution works quite well, except it doesn't work here because we want to actually delay the evaluation of the expression of the operators until we deem it necessary to evaluate them.
Two ideas:
Some kind of lazy operators table in the scope which takes expressions instead of the direct scope items
Special BooleanOr and BooleanAndast::Expression enum variants which have to be handled everywhere using a special intrinsics::boolean_or or intrinsics::boolean_and function
Either way, the solution to this needs to be thought about more before it is implemented.
The text was updated successfully, but these errors were encountered:
Short-circuit evaluation
This is less of a problem now because we don't have functions yet (#16), but this is a very important property of booleans that should be properly implemented sooner rather than later.
The problem is that boolean operators are implemented as regular functions (like stdout.print, etc.). They just have "internal-only" names which are only callable from inside the compiler. This solution works quite well, except it doesn't work here because we want to actually delay the evaluation of the expression of the operators until we deem it necessary to evaluate them.
Two ideas:
BooleanOr
andBooleanAnd
ast::Expression
enum variants which have to be handled everywhere using a specialintrinsics::boolean_or
orintrinsics::boolean_and
functionEither way, the solution to this needs to be thought about more before it is implemented.
The text was updated successfully, but these errors were encountered: