September 15, 2004
Lisp Mindstorms

drawing by zoe charlton
Zoë Charlton, Mid America Greetings #1

XS Lisp, by Taiichi Yuasa, is a Lisp programming environment for Lego Mindstorms. Unlike LegoLisp or LegoScheme,which run on a PC and send commands to the RCX computer, XS Lisp runs right on the RCX itself.

XS Lisp includes the following features:

  • read-eval-print loop
  • interactive definition and re-definition of functions
  • appropriate error messages with backtraces
  • function trace and untrace
  • dynamic object allocation and garbage collection
  • robustness against program errors and stack/buffer overflow
  • terminal interrupts
  • truly tail-recursive interpreter
  • event/timer waiting and asynchronous event watchers
  • interface to RIS devices such as motors, sensors, lights, and sounds

Here's some sample code, from Taiichi's ILC 2003 paper:

(define (forward)
  (motor :a (motor :c :forward))
  (play '((:Re4 . 2) (:Do4 . 1) ...)))

  (speed :a (speed :c :max-speed))
    (((touched? 2)
      (motor :a (motor :c :back))
      (sleep 5)
      (motor (if (= (random 2) 0) :a :c)
      (sleep 5)
    (wait-until (pressed?))
    (motor :a (motor :c :off))))

Pete Hopkins blogged some notes from Taiichi's ILC talk back in November of last year.

Posted by jjwiseman at September 15, 2004 08:13 AM
Post a comment

Email Address:


Unless you answer this question, your comment will be classified as spam and will not be posted.
(I'll give you a hint: the answer is “lisp”.)


Remember info?