Archive for the ‘Uncategorized’ Category

read-char and Java System.in

Wednesday, January 30th, 2008

I’ve been reading Brian Harvey’s Computer Science Logo Style. So I thought I would try to implement on of his projects in ISLisp to work out some kinks and to use lisp to write a program. I picked the tic tac toe program (although that is here nor there). The problem was that all the programs are console applications and Brian likes to use the readChar functionality which allows for input with needing to press return.

Well Java doesn’t easily allow for that. The Standard Input stream requires a Return before read will return even the first charecter. What am I going to do with that? Well for now the user will have to press enter.

Using dayLISP with Emacs

Wednesday, January 2nd, 2008

Fortunately Emacs is a great editor for lisp (figures since much of it is written in lisp). For the trivia lovers look at this history of Emacs. Whe I play with dayLISP and write lisp for it I use Emacs and run dayLISP in an inferior lisp buffer in Emacs. Emacs then has key combinations to evaluate lisp expressions in your file in the lisp interpretor. This allows for a quick way to try stuff in lisp.

Quick instructions for current Emacs Users

  1. Create a batch/script file somewhere in the PATH of your machine. The script should be called lisp and include the command: java -jar dayLISP.jar providing adequate paths for java and the jar file.
  2. Test the batch/script file by typing lisp at the command prompt while not in the same directory as the file.
  3. Start Emacs
  4. Use the command M-x run-lisp This will start dayLISP and show the REPL in a new buffer called *inferior-lisp*. (Emacs by default executes lisp at the system prompt and sets the input and output of the process to the new buffer.)
  5. Create a buffer for your lisp source file. Name files with the lsp extension. Files with lsp or lisp extensions will be treated as lisp source in Emacs.
  6. When you want to evaluate a lisp form put the point within the form and press C-M-x. Looking at the REPL buffer you will see the results. If the form you evaluated was a defun or other defining form you can exercise it in the REPL.

Instructions from other Emacs sites with more information

Welcome to dayLISP

Wednesday, January 2nd, 2008

NOTE: I am in the very early stages of getting this into SourceForge. The lisp interpreter software is further along than the documentation, but you will probably want to wait a little while.

If you are ready to jump in and try it right now:

  1. You will need a Java JVM version 1.5 or later.
  2. You will need the jar from the files section of the SourceForge project.
  3. You will need the 20.3 spec for ISLISP as it is the only documentation right now.
  4. You will need patience.

Once you have the JVM and the jar you can start the interpreter by typing the following command while in the same directory as the jar.

java -jar dayLISP.jar

You can leave the interpreter by typing (quit) at the REPL prompt.

I have been working on this on and off for a few years. It is my experiment project. I do hope to have a fairly mature ISLISP interpreter in the end. If you want to help please send me a note. Also I’d be happy to correspond with you about the current status of the interpreter.

Welcome to the new dayLISP Project site

Wednesday, January 2nd, 2008

I’ve installed WordPress as the cms for this project.  A Blog seems like a good format for documenting the project most of the time.

And when a blog doesn’t suit I think WordPress will give enough flexibility.

Cheers,

Matthew