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.

Layout of error messages

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

Errors from format function

The format function has a special layout of error messages, to show the directive in the format string that caused the error; for example:

> (format t "The result is ~a ~q" 42)
The result is 42 
    "The result is ~a ~q"
                       ^
Error: 'format' invalid directive

Here are the specific error messages that can occur with the format function:

argument is not a list

The argument for a ~{ directive is not a list.

can't nest ~{

Currently uLisp only supports one level of ~{~}.

invalid directive

The directive is either invalid or not supported by uLisp.

missing argument

The argument for a directive is missing.

no matching ~{

A ~} directive has been encountered without an opening ~{.

quote not valid

A quote can only appear after a comma.

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.

argument is not a bit value

The argument to a bit array is not 0 or 1. For example:

> (defvar a (make-array 10 :element-type 'bit :initial-element 0))
> (setf (aref a 4) 2)
Error: 'setf' argument is not a bit value: 2

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"

Or, in format the argument for a ~{ directive is not a list.

argument is not a list, 1d array, or string

The argument to length must be a list, one-dimensional array, or string. For example:

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

argument is not a number

The argument to a numeric function was not an integer or floating-point number. For example:

> (abs "Hello")
Error: 'abs' argument is not a number: "Hello"

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 a function expecting a symbol is not a symbol. For example:

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

argument is not an array

The argument to array-dimensions must be an array.

argument not recognised

The keyword argument to make-array must be :initial-element or :element-type.

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 be used as a function

The symbol can't be used as a function. For example:

> (&rest 2)
Error: '&rest' can't be used as a function

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' can't 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 evaluate CODE header

A form defined with defcode cannot be evaluated.

can't nest ~{

In format uLisp currently only supports one level of ~{~}.

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

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

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

dimension can't be negative

An array dimension can't be negative. For example:

> (defvar a (make-array -10))
Error: 'make-array' dimension can't be negative

dimensions can't be nil

In uLisp the array dimensions can't be nil. For example:

> (defvar a (make-array nil))
Error: 'make-array' dimensions can't be nil

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))
Error: 'assoc' element is not a list: c

error in print

Trying to print something that can't be printed.

escape!

The escape character '~' was typed.

first argument is not an array

The first argument to aref is not a valid array. For example:

> (aref "hello")
Error: 'aref' first argument is not an array: "hello"

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 #', #*, #., #\, #(, #nA, #|, #b, #o, or #x.

illegal character in bit array

A bit array being defined with #* contains a character other than 0 or 1. For example:

> #*1010102
Error: illegal character in bit array

illegal clause

The arguments to case or cond included an illegal clause.

illegal entry

The arguments to defcode should be a symbol, integer, or list of integers.

illegal function

The specified function is illegal. For example:

> (funcall let)
Error: 'funcall' illegal function: let

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, restnth, and aref 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 can't be negative

The index argument to nth or subseq can't be negative. For example:

> (subseq "ulisp" -1 2)
Error: 'subseq' index can't be negative: -1

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 out of range

In a reference to nth in setfincf, or decfpush, 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

initial contents don't match array type

An array definition is incorrect. For example:

> #2A((1 2) (3 4) (5))
Error: initial contents don't match array type

invalid argument

The argument to saveimage, loadimage, or length is not a list or string.

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 directive

In format the directive is either invalid or not supported by uLisp.

invalid pin

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

invalid result

The arguments to expt give an invalid result. For example:

> (expt -1 .3)
Error: 'expt' invalid result

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

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

> (when)
Error: 'when' missing argument

Or, in format the argument for a directive is missing.

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.

more than 4 parameters

Functions defined with defcode can have a maximum of four parameters.

no DataFlash found

The save-image, load-image, or autorun function failed because no DataFlash could be found.

no matching ~{

In format~} directive has been encountered without an opening ~{.

no room

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

no saved image

No saved image was found.

not available

The save-image or load-image function is not available on this platform, or SD card support has not been enabled.

not a stream

The argument to a stream function is not a stream.

not a symbol

The argument to defvardefun, or defcode is not a valid symbol.

not an i2c stream

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

not enough room for code

There is not enough room for the machine-code function being defined with defcode. Either delete another function with makunbound to make room, or increase the value of:

#define CODESIZE

for the platform,

not supported

SD card support is not available.

not tracing

The untrace command specified a function that wasn't being 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.

odd number of arguments

The special forms setq, setf, and set should have an even number of arguments.

only supports strings

In uLisp concatenate 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 loading from SD card

There was a problem loading a saved image from the SD card. For example, the image was not found.

problem reading from SD card or invalid filename

There was a problem reading from the SD card. For example, the filename was longer than 8 characters or 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 or invalid filename

There was a problem writing to the SD card. For example, the filename was longer than 8 characters or the SD card has been removed.

quote not valid

In format a quote can only appear after a comma.

result is not a bit value

The special form incf or decf is being applied to a bit array, but the result is not 0 or 1.

result is not a proper list

The result being constructed by mapcan is not a proper list. For example:

> (mapcan (lambda (x) x) '((a b) (c . d) (e f)))
Error: 'mapcan' result is not a proper list: d

save-image not available

On this platform save-image is not supported.

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"

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. On platforms with stack overflow detection it may be necessary to adjust the value of:

#define STACKDIFF

subscript out of range

The subscript to an array exceeds the size of the corresponding dimension. For example:

> (defvar a (make-array '(4 4)))
> (aref a 2 4)
Error: 'aref' subscript out of range: 4

symbol table full

The table of long symbols is full. Increase the value of:

#define SYMBOLTABLESIZE

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 few arguments

A function is being called with fewer arguments than it expects. For example:

> (mod 2)
Error: 'mod' too few arguments

too many arguments

A function is being called with more arguments than it expects. For example:

> (expt 2 3 4)
Error: 'expt' too many arguments

too many long symbols

uLisp is restricted to 1535 long symbols.

too few subscripts

An array element doesn't specify enough subscripts. For example:

> (defvar a (make-array '(4 4)))
> (aref a 2)
Error: 'aref' too few subscripts

too many subscripts

An array element specifies too many subscripts. For example:

> (defvar a (make-array '(4 4)))
> (aref a 2 2 2)
Error: 'aref' too many subscripts

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.