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

am I mistaken in thinking that part of this problem is a desire to not pollute the namespace since most(all?) lisps are unable to properly privatize functions?


Yes. You can define functions locally with "flet" or "labels" and never touch the global namespace. This alone is enough so that you don't have to resort to lambdas to avoid polluting the global namespace. In addition Common Lisp provides both generic methods and packages, which both provide a means of managing the global namespace, so one should never use lambdas for that purpose.


You can also use (define) inside others (define) if you want private functions. And, because of closures, it makes it extremely powerful and flexible since you don't have to repeat parameters already given in the outer scope.


Perhaps this is true in CL, but Clojure makes it easy to define private functions.

In the case of the particular example he points to it's just a long function because many people contributed to that function over a period of several months.


Thanks! I didn't know about defn-

Time for refactoring :D




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

Search: