Month: May 2006

Better Abstractions

A common complaint about Object-Oriented Programming (OOP) is that classes can make simple data hard to deal with: “I don’t want a DirectoryList object, I just want a list of strings.” I would say this is not a flaw inherent in OOP but rather in the way it is commonly used. “Encapsulation” and “data hiding”…

Read the full article

Types Are Not Classes, But Why?

In Common Lisp, you can’t do this: (defgeneric g (x)) (defmethod g ((x (and integer (satisfies evenp))) …) Because (and integer …) is not a class. It is a valid type specifier and thus could be used in declarations, but it cannot be used in a method argument list. It’s fairly easy to see why…

Read the full article

A Textual CAPTCHA in Lisp

Playing with the first in a (hopefully ongoing) series of Common Lisp Quizzes, I wrote a simple text-only CAPTCHA (completely automated public Turing test to tell computers and humans apart). My solution and others are posted at CL Quiz #1. CAPTCHA> (generate-captcha) “You started out with forty-nine Lisp Machines. Not through any fault of your…

Read the full article