Open antarestrader opened 9 years ago
A thought last night: Create a value "Macro" and understand that a call to a macro should receive functions whose evaluation results in the needed value.
When eval (Apply ...) finds a macro rather then a function, it creates functions out of each argument expression and passes those in as the arguments.
example:
defmacro "||" (a,b)
aa = a() # evaluate a
if aa then aa else b() # evaluate and return b only if a is falsy
&& and || need to short circuit when the first operand is sufficient to determine the final value.
This may take some reworking as currently all calls are call-by-value.