News for hackers. Stuff that matters.
Re:Ask HN: I know Haskell, Clojure, Scheme. Should I learn CL? by tsm on Monday December 12, 2011 @08:49PM (#3345963)
It's an interesting language since it's (obviously) all beautiful and Lispy, and has good support for functional ideas...yet very much encourages a "get it done" approach.

For example, here's something like how a Schemer might implement filter (although this seems long to me...am I missing something?):

    (defun filter (predicate list)
      (if list
          (let ((head (car list))
                (tail (cdr list)))
            (if (funcall predicate head)
                (cons head (filter predicate tail))
                (filter predicate tail)))
          '()))

But realistically, a CLer would probably just use the loop macro:

    (defun filter (predicate list)
      (loop for elem in list
         if (funcall predicate elem)
         collect elem))

So if you're interested in a non-castrated language that very deliberately tries to be practical (if at times inelegant)...it's worth a look. Pick up the book Land of Lisp if you're in a whimsical mood, or Practical Common Lisp if you're not.

There are no comments on this comment yet.