Hacker News new | ask | show | jobs
by lispm 697 days 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)
1 comments

You're right, the example I wrote was in Racket. I didn't know "everything is an expression" wouldn't work in CL.
Everything 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)