Closed JobLeonard closed 3 years ago
Hi @JobLeonard,
Yes, wax takes special care that &&
||
and a?b:c
are short-circuited in all targets.
(set c (&& a b))
is compiled totmp = a
if (tmp) tmp = b
c = !!tmp
Glad you're enjoying the project!
Cool, thanks for explaining! :)
Quickly added line to the quickstart doc to mention it there too
Hi, this is a cool project, I'm really enjoying reading through it right now.
Quick question regarding this part of the QUICKSTART.MD documentation:
I'm not proficient in all the languages that Wax compiles to, but the ones that I do know would use short-circuit evaluation on this expression - that is, if
a
is false, then expressionsb
andc
are not evaluated. Does wax also do this to? Or does it always evaluate all expressions? In either case, does it take special care that all compile targets behave as expected? Or does it not make any assumptions about this at all?https://en.wikipedia.org/wiki/Short-circuit_evaluation