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

Lisps lack implicit currying, so function composition becomes much more verbose.

And functions aren't that important in CL, not everything is a function and CL is usually written in an OOP or procedural style. CL is more about data and AST composition then anything else.

Moreover, CL is a lisp-2, so in a very real sense, functions are second class citizens in the language.



Or, you use reader macros to make currying concise.

https://github.com/eschulte/curry-compose-reader-macros

Functions are not second class citizens. They are privileged with their own namespace. That's a perk, not a penalty.

One notable form of composition in CL is method combination. Does any other language support something like that?


Having to prefix functions with #' is a perk? No other language uses a separate name space for functions, and for good reason, because it sucks.


It's an optimization for usability. Many more symbols occur as the heads of list forms than appear after #'. So, the common case is optimized for clarity and the relatively uncommon case requires two extra characters.

I completely disagree that it sucks. What sucks is having to remember not to have your variable names collide with your function names (or indeed any of the other namespaces in CL). Things that are usually used in different ways benefit from having separate namespaces.




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

Search: