New beta version of ARM uLisp with new features for feedback


Following the helpful feedback on my proposed list of new features for uLisp I have now built a new experimental ARM version containing the most requested features, and I’d welcome your feedback.

You can download the new version from GitHub here: uLisp ARM Beta.

You can read a full description of the new features here: uLisp ARM 3.2 Beta.

Here’s a summary of the new features:

Line editor

If you compile uLisp with the option:

#define lineeditor

uLisp provides an input buffer, allowing you to correct mistakes by pressing the delete key, or typing backspace. The line is not submitted to the REPL until you press enter.

This is designed for using uLisp from a serial terminal rather than the Arduino IDE’s Serial Monitor.

Parenthesis matching

There’s also an experimental option: if, in addition, you include the option:

#define vt100

uLisp uses ANSI standard terminal codes to implement parenthesis matching, highlighting matching parentheses in inverse video as you type. However, on my terminal (Mac screen) this doesn’t work correctly once you type past the end of the screen, causing the line to wrap. This may just be a problem with screen’s terminal emulation, and I’d welcome feedback on this.


uLisp now includes arrays, as a more efficient and convenient alternative to using lists with nth etc. With a 5000-element array it is on average approximately 20 times faster to access elements than with a 5000-element list.

Arrays in uLisp can have one or two dimensions. The size of arrays is limited only by the amount of available workspace.

Arrays will be useful for collecting data from sensors, or processing mathematical functions. When you save your workspace with save-image, arrays and their current contents are saved too.

Arrays are created with make-array, and accessed or changed with aref.

Outputting to a string

You can now create a stream that outputs characters to a string and returns it, using with-output-to-string.


uLisp now supports a subset of Common Lisp’s format function, for formatting output neatly using a control string containing format directives; the directives supported are:

The ~a, ~s, ~d, ~g, or ~x directives for outputting values; these can also can include a width parameter after the tilde, and some can specify an optional pad character.

The ~{ and ~} directives which allow you to format elements in a list.

The ~% and ~& directives for outputting line breaks.

New beta 2 release of ARM uLisp for feedback
What new features would you like to see in uLisp?

3 posts were split to a new topic: Terminal support on the new ARM 3.2 beta


13 posts were merged into an existing topic: Proposal to store immediate values in the object cell


It’s a pity that there isn’t a cursor-right equivalent to CTRL-8, as that would be a clean way of implementing it.


Trying to compile the beta for Adafruit’s Grand Central M4 (SAMD51) and I get this (a number of times) throughout:

/home/rusty/sketchbook/ulisp-arm-beta/ulisp-arm-beta.ino: In function 'boolean FlashSetup()':

ulisp-arm-beta:486:16: error: ‘ssel’ was not declared in this scope
digitalWrite(ssel, HIGH); pinMode(ssel, OUTPUT);

Guess the correct pins for the data FLASH aren’t getting defined.


BTW, what does a CTRL-8 do?


ASCII (control) code 0x08, ^H: Backspace.

I believe Ctrl and the numbers are not valid characters.


That’s odd - I’ve just tried it with the Adafruit Grand Central M4 and it works fine for me. Have you definitely got the Adafruit Grand Central M4 (SAMD51) boards option selected? Have you got the latest Adafruit SAMD Boards package loaded? I’m using 1.5.10.


I’ve built an AVR version of uLisp 3.2 beta, but for some reason arrays don’t work and I haven’t yet been able to track down the bug. It looks as if it will fit on the Arduino Uno (32 Kbytes) with either format or arrays, but not both.


Indeed, they aren’t valid ASCII characters but various OS’s may react to
that keyboard combo.


OK, I updated Arduino to 1.8.12. I also deleted the 1.5.3 SAMD library because it would error out whenever I tried to update it. It be compiling just peachy now. Sorry 'bout that!


Yes, but that’s because modern interfaces don’t usually pretend to be terminals. :)


Good to hear it’s working!


OK, I am joining the Beta test…

Trying to compile on 1.8.12, and enabling the line editor and the vt100 support, I am getting on a Grand Central M4:

‘ssel’ was not declared in this scope

with offending element:

inline void FlashEndWrite (void) {
digitalWrite(ssel, 1);


This seems to be the same issue @fe2o3 was having. Have you tried re-installing the SAMD board library?


OK, seems adding this (from a previous ulisp version) to the board definitions of ssel helped:

const int sck = 89, ssel = 90, mosi = 91, miso = 92;



Backspace is working and parentheses-matching is working… Lisp machine, baby, Lisp machine! :D

Now, what obviously doesn’t work but likely matters little: the numpad. I have a German keyboard. The numpad is giving strange signals. - Now, given most devices do not have a numpad (laptops, tablets), I guess this falls into the “irrelevant, live with it” section, I am just mentioning it.


(print “(”) works fine, but neither (print #( ) nor (print #) ) do.


Last December David gave me a way to test save-image and load-image, and I confirm the procedure described here works:


By ‘works’ do you mean just the paragraph highlighting? If so, see: Terminal support on the new ARM 3.2 beta