JavaScript LISP Interpreter

by Joe Ganley

ASSESSMENT QUIZ


[Introduction] | [Language Specifications] | [Copy Permissions]

PROCEDURE:

Click START;

  1. In the side frame of this window you will be given a LISP function to define;
  2. Enter your answer to each problem in the INPUT text box below, and test it as usual;
  3. When you are satisfied that your definition is correct, click the DONE button;
  4. The system will then grade your submission, and give you the score;
  5. If this was the first problem a second one will be displayed; repeat the above process;
  6. Finally the total score will be submitted to the grading system.

INPUT

OUTPUT


Joe Ganley's Introduction

I wanted to get a feel for just how powerful JavaScript is as a programming language (as opposed to just a scripting language), so I sat down one evening and wrote this. It turns out that it was quite good for this application, since it is so flexible - dynamically sized arrays are used throughout, and associative arrays make the symbol table quite easy.

A fairly complete set of Lisp instructions are implemented (see here). The choice of instructions and some of the implementations of the composite functions were taken from Roger Rohrbach's Lisp in Awk interpreter. The syntax is standard, and only integer arithmetic is available. This is Lisp, not Scheme - scoping is dynamic.

Since this is pretty much a toy, it doesn't do much in the way of error handling. However, it should work on correct Lisp code; if it breaks on code you believe to be correct, please send me mail at joe@ganley.org.

Permission

The source of this interpreter is copied by permission from Joe Ganley per his copying restrictions.


NOTE: In this version it is not necessary to include the function name and the arguments in a list as in "standard" LISP.


Portions copyright © 1997 Joe Ganley, modified by J.A.N. Lee, 2001.