Error messages

This page gives a list of all the error messages, in alphabetical order, with an explanation of the message, and if appropriate an example that would generate the error. Where possible it also includes suggestions of how to fix the error.

This page applies to Version 2.8 of uLisp and later. For information about the error messages in earlier versions of uLisp see: Error messages.

Format

Each error message consists of up to three components:

ErrorFormat.gif

  • Context is the name of the built-in or user-defined function in which the error occurred.
  • Message is the explanation of the error.
  • Value is the value causing the error.

The Context field is omitted if there's no appropriate context; for example:

> #!
Error: illegal character after #

It's also not possible to give a context if the error occurs in a function supplied to another function; for example:

> (mapc (lambda (x y) (cons x y)) '(a b c))
Error: function has too few arguments

The Value field is omitted if there's no appropriate value to show; for example:

> (cons 2)
Error: 'cons' has too few arguments

Alphabetical list of error messages

The following list gives the possible error messages, in alphabetical order.

already being traced

The specified function is already being traced.

already tracing 3 functions

The trace command was given for a function when three functions are already being traced.

arithmetic overflow

Overflow occurred in a numeric expression on a 16-bit platform. For example:

> (* 400 100)
Error: '*' arithmetic overflow

argument is not a character

The argument to char-code is not a character. For example:

(char-code "a")

argument is not an integer

The argument to a function expecting an integer is not an integer. For example:

> (nth 2.0 '(a b c))
Error: 'nth' argument is not an integer: 2.0

argument is not a list

The argument to a function expecting a list is not a list. For example:

> (append "cat" "dog")
Error: 'append' argument is not a list: "cat"

argument is not a list or string

The argument to length must be a list or string. For exaomple:

> (let ((a 12345)) (print (length a)))
Error: 'length' argument is not a list or string: 12345

argument is not a proper list

The argument to a function expecting a list must be a list not containing a dotted pair. For example:

> (assoc 'a 'b)
Error: 'assoc' argument is not a proper list: b

argument is not a string

The argument to a function expecting a string is not a string. For example:

> (read-from-string 123)
Error: 'read-from-string' argument is not a string: 123

argument is not a symbol

The argument to require is not a symbol. For example:

> (require 3)
Error: 'require' argument is not a symbol: 3

arithmetic overflow

On a 16-bit platform overflow occurred in an expression. For example:

(setq a -32768)
(decf a)

autorun not available

On this platform autorunning a function after load-image is not supported.

can't convert to string

The string function was called with an argument that wasn't a symbol or character. For example:

> (string 3)
Error: 'string' cannot convert to string: 3

can't evaluate a dotted pair

An attempt was made to evaluate a dotted pair. For example:

> (print . 3)
Error: Can't evaluate a dotted pair: 3

can't take car

The argument to car is not a list. For example:

> (car 12)
Error: Can't take car: 12

can't take cdr

> (cdr 12)
Error: Can't take cdr: 12

division by zero

Attempt to divide by zero. For example:

> (/ 2.0 0)
Error: '/' division by zero

element is not a list

Each element in the second argument to assoc must be a list. For example:

(assoc 'a '((b . 2) c))

escape!

The escape character '~' was typed.

flash erase failed

A call to save-image failed to erase the stm32 flash.

flash write failed

A call to save-image failed to write to the stm32 flash.

function has too few arguments

A function supplied to funcall, apply, mapc, mapcar, mapcan, or sort has been called with fewer arguments than it was defined with. For example:

> (funcall mod 2)
Error: function has too few arguments

function has too many arguments

A function supplied to funcallapplymapcmapcarmapcan, or sort has been called with more arguments than it was defined with. For example:

> (funcall abs 2 3)
Error: function has too many arguments

has too few arguments

A function has been called with fewer arguments than it was defined with. For example:

> (defun sq (x) (* x x))
> (sq)
Error: 'sq' has too few arguments

has too many arguments

A function has been called with more arguments than it was defined with. For example:

> (defun sq (x) (* x x))
> (sq 2 3)
Error: 'sq' has too many arguments

illegal argument

Invalid argument to save-image. For example:

(save-image 23)

illegal character after #

In uLisp # can only be followed by '\', 'B', 'b', 'O', 'o', 'X', or 'x'.

illegal clause

The arguments to case or cond included an illegal clause.

illegal function

The specified function is illegal. For example:

> (23 nil)
Error: illegal function: 23

illegal name

The argument is not a legal symbol name.

illegal optional parameter

The optional parameter is not a symbol. For example:

> (defun sq (x &optional (2 3)) (* x x))
> (sq 2)
Error: 'sq' illegal optional parameter: 2

illegal parameter

The optional parameter is not a symbol. For example:

> (defun sq (x &optional 3) (* x x))
> (sq 2)
Error: 'sq' illegal parameter

illegal place

The in-place operations setf, incfdecf, push, and pop can only take the functions car, firstcdr, rest, and nth in their second argument. For example:

> (defvar a '(1 2 3 4))
> (setf (second a) 7)
Error: 'setf' illegal place

The solution is to rewrite the second argument in terms of these functions:

(setf (car (cdr a)) 7)

image size too large

The size of the workspace is larger than the available non-volatile storage.

incomplete list

A close bracket was typed with no matching opening bracket.

incorrect number of arguments

A call to with-spi must have five arguments.

index out of range

The index argument to char or subseq is outside the range of the characters in the string. For example:

> (char "cat" 3)
Error: 'char' index out of range

index to nth is not a list

In a reference to nth in setfincf, or decf, push, or pop the index is out of range. For example:

> (incf (nth 3 '(1 2 3)))
Error: 'incf' index to nth is out of range

invalid default value

A default value was supplied without the &optional keyword. For example:

> (defun sq (x (y 3)) (* x y))
> (sq 3 2)
Error: 'sq' invalid default value: (y 3)

invalid pin

The analogreadanalogwrite, or note function is not supported on the specified pin.

malformed list

The list is not a valid dotted list because more than one object follows a dot. For example:

> (a . b c)
Error: Malformed list

missing argument

unlesswhen, dolist, and dotimes must be followed by at least one argument. For example:

> (when)
Error: 'when' missing argument

missing argument(s)

if must be followed by at least two arguments. For example:

> (if (print 3))
Error: 'if' missing argument(s)

missing stream argument

The stream argument is missing from a with-spi, with-sdcard, with-i2c, or with-serial form.

no saved image

No saved image was found.

no room

There is no space left in the Lisp workspace. Delete some functions or variables using makunbound.

no room for long symbols

The ATmega328 version of uLisp doesn't support long symbols of more than 3 characters, or symbols containing characters other than a-z or 0-9, because there isn't enough memory.

Other versions of uLisp may give this error if you've defined a large number of symbols, and there is no space left in the symbol table. From now onwards you will be restricted to 3-character symbols.

not a symbol

The argument to defvar or defun is not a valid symbol.

not an i2c stream

The stream supplied to restart-i2c is not an I2C stream.

not supported

SD card support is not available.

not tracing

The untrace command specified a function that hadn't been traced with trace.

not valid here

The first item in a list is not a valid function. For example:

> ('a 2 3)
Error: not valid here: (quote a)

number out of range

A number has been entered that is out of range for the platform. For example:

(print 40000)

octave out of range

The octave specified for the note function is out of range for the PWM output.

only supports strings

In uLisp concatenate currently only supports strings. For example:

> (concatenate 'list '(a b c) '(d e f))
Error: 'concatenate' only supports strings

port not supported

The port is not supported on this platform.

problem autorunning from SD card

The file ULISP.IMG was not found.

problem reading from SD card

There was a problem reading from the SD card. For example, the file was not found.

problem saving to SD card

There was a problem saving an image to the SD card. For example, the SD card has been removed.

problem writing to SD card

There was a problem writing to the SD card. For example, the SD card has been removed.

save-image not available

On this platform save-image is not supported.

second argument to nth is not a list

In a reference to nth in setf, incf, or decf, the second argument is not a list. For example:

> (incf (nth 2 "cat"))
Error: 'incf' second argument to nth is not a list: "cat"

stack overflow

The Lisp stack has overflowed. It may be necessary to restart uLisp.

second argument is not a proper list

The second argument to mapcmapcar, or mapcan is not a proper list. For example:

> (mapc print "cat")
Error: 'mapc' second argument is not a proper list: "cat"

third argument is not a proper list

The third argument to mapc, mapcar, or mapcan is not a proper list. For example:

> (mapcan list '(a b c) '(d e . f))
Error: 'mapcan' third argument is not a proper list: (d e . f)

too many long symbols

uLisp is restricted to 1535 long symbols.

undefined

A symbol has been evaluated that has not yet been defined.

unknown character

The escape sequence #\ is followed by an unknown character. For example:

#\FRED

unknown stream type

The stream type is unknown.

unknown variable

A symbol has been referenced that has not yet been defined. For example:

> (setq a 23)
Error: unknown variable: a

unmatched right bracket

A right bracket was typed with no matching left bracket.