5 ms·
Technically this works in Scheme, but not in Lisp. In Common Lisp one would need to write (funcall (if (< 1 0) (function +) (function *)) 42 100)
by lispm 2y ago
Technically this works in Scheme, but not in Lisp.
In Common Lisp one would need to write
(funcall (if (< 1 0) (function +) (function *)) 42 100)
- behnamoh 2y agoYou're right, the example I wrote was in Racket. I didn't know "everything is an expression" wouldn't work in CL.
- kagevf 2y agoEverything is still an expression in CL, but you have to account for different namespaces. Also, the above can be further shortened to: (funcall (if (< 1 0) #'+ #'*) 42 100)