Every programming language has idioms–patterns used so frequently that they are almost considered part of the language itself. (See these C idioms for examples.) Common Lisp, with almost unlimited possibilities for syntax, depends more heavily on idioms to remain comprehensible. Some examples are defsomething or define-something for definitions, something-p for predicate tests, and make-something for… Continue reading Idiomatic Macros for Common Lisp
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”… Continue reading Better Abstractions
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… Continue reading Types Are Not Classes, But Why?
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… Continue reading A Textual CAPTCHA in Lisp
Steve Oualline wrote a nifty little Perl program to graph regular expressions. And Oliver Steele wrote an even niftier OpenLaszlo app to show how regular expressions work. Together, they make the best (unintended) argument I’ve seen for visual programming languages. As Oualline writes in his article, “Humans can process images far faster and better than… Continue reading Visual Regular Expressions
Just recently discovered the E Programming Language. Very interesting concept. It’s nice to see a something growing out of the Algol/C/C++/Java tree that improves the syntax. And a mainstream language that can handle concurrency well without blocks and locks is definitely needed. Making programmers deal with threads and mutexes is definitely too hard, just like… Continue reading Curious About E
Given the task of designing a programming language, which must be exactly defined for engineering purposes, what would a linguist — as opposed to a mathemetician — do?
Why does Lisp use hyphens instead of underscores or CamelCase? [Read more…]
What would a programming language designed by a linguist look like? [Read more…]