Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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)


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)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: