Levi's Lisp Log

Thoughts and links relating to Lisp and computer theory

Context-Oriented Lisp

Thanks to the extensive metaprogramming facilities in Common Lisp, it is often used as an experimental testbed for new programming paradigms. Recently, Pascal Costanza and Robert Hirschfeld have come up with a new form of program structuring called Context-Oriented Programming.

Roughly, the idea is to create different "layers" in the software that expose different portions of objects' interfaces. This allows for changes in behavior based on context rather than just the traditional mechanisms of subtyping and composition. I'd explain further myself, but Bill Clementson has created a tutorial based on the example in Costanza and Hirschfeld's paper that does a better job than I could.

If you'd like to try it out, the ContextL extension to Common Lisp can be found at the Closer Project site, along with additional information about ContextL and Common Lisp's Meta-Object Protocol, which made ContextL possible.

# Posted by: Levi at 1:39 PM on Tuesday, September 13, 2005
   Comments: (0) Categories: Lisp Language-design OOP

Prototype-Based Object Systems

Most well-known object-oriented programming languages have a concept of class, which defines a set of shared information for a group of objects. In these languages, every object is an instance of at least one class, and inheritance is defined between the classes. There is, however, an alternate way to define shared data and inheritance among objects: Prototype-based object systems. These languages use prototypical objects instead of classes to determine shared traits, which allows for some interesting flexibility that is not commonly found in class-based systems. Some examples of prototype-based languages are Self, Javascript, and Io.

# Posted by: Levi at 9:44 PM on Monday, June 6, 2005
   Comments: (0) Categories: OOP
<< 1 >>