Common Lisp vs Java

By vijay on March 17, 2010 — 1 min read

I’ve been sort of wanting to learn LISP for long time (~ 10 years). Now finally I got some chance to try that out. I’ve started reading On Lisp by Paul Graham along with Practical Common Lisp by Peter Seibel. I find them pretty invaluable in learning Lisp.

It has been nearly 9 years since I’ve started learning Java, during my programming adventures, I’ve used COBOL, Perl and Ruby. But never got to build a complete application purely using functional programming. Partly inspired by on The Reinvigorated Programmer, I start my journey of learning Common Lisp.

I’m trying to compare how I do things in Java with the exercises/programs I write while learning Lisp. Here’s the first installment:

The following Common Lisp created a database of CDs with some data, and provides methods to store the database to a file and load the same from the file.

First the Common Lisp program:

And here’s the Java version (without saving and reading from file).

Database.java

CompactDisc.java

Main.java

This is not one-to-one comparison between Common Lisp version and Java version, this is just part of my note taking while learning LISP and wrap my head around a new language.

Posted in: Programming

Leave a comment

Leave a Reply