Next: Command-line options, Previous: Package zeilberger, Up: Top [Contents][Index]

## 101 Error and warning messages

This chapter provides detailed information about the meaning of some error messages or on how to recover from errors.

Next: Warning Messages, Up: Error and warning messages [Contents][Index]

### 101.1 Error Messages

Next: argument must be a non-atomic expression, Previous: Error Messages, Up: Error Messages [Contents][Index]

#### 101.1.1 apply: no such "list" element

One common cause for this error message is that square brackets operator (`[ ]`) was used trying to access a list element that whose element number was `< 1` or `> length(list)`.

Categories: Error messages ·

Next: cannot assign to function, Previous: No such list element, Up: Error Messages [Contents][Index]

#### 101.1.2 argument must be a non-atomic expression

This normally means that a list, a set or something else that consists of more than one element was expected. One possible cause for this error message is a construct of the following type:

    (%i1) l:[1,2,3];
    (%o1)                       [1, 2, 3]

    (%i2) append(l,4);
    append: argument must be a non-atomic expression; found 4
     -- an error. To debug this try: debugmode(true);

The correct way to append variables or numbers to a list is to wrap them in a single-element list first:

    (%i1) l:[1,2,3];
    (%o1)                       [1, 2, 3]

    (%i2) append(l,[4]);
    (%o2)                     [1, 2, 3, 4]

Categories: Error messages ·

Next: 0 to a negative exponent, Previous: argument must be a non-atomic expression, Up: Error Messages [Contents][Index]

#### 101.1.3 assignment: cannot assign to `<function name>`

Maxima supports several assignment operators. When trying to define a function `:=` has to be used.

Categories: Error messages ·

Next: Comma is not a prefix operator, Previous: cannot assign to function, Up: Error Messages [Contents][Index]

#### 101.1.4 expt: undefined: 0 to a negative exponent.

This message notifies about a classical division by zero error.

Categories: Error messages ·

Next: Illegal use of delimiter, Previous: 0 to a negative exponent, Up: Error Messages [Contents][Index]

#### 101.1.5 incorrect syntax: , is not a prefix operator

This might be caused by a command starting with a comma (`,`) or by one comma being directly followed by another one..

Categories: Error messages ·

Next: loadfile failed to load, Previous: Comma is not a prefix operator, Up: Error Messages [Contents][Index]

#### 101.1.6 incorrect syntax: Illegal use of delimiter )

Common reasons for this error appearing are a closing parenthesis without an opening one or a closing parenthesis directly preceded by a comma.

Categories: Error messages ·

Next: makelist second argument must evaluate to a number, Previous: Illegal use of delimiter, Up: Error Messages [Contents][Index]

#### 101.1.7 loadfile: failed to load `<filename>`

This error message normally indicates that the file exists, but can not be read. If the file is present and readable there is another possible for this error message: Maxima can compile packages to native binary files in order to make them run faster. If after compiling the file something in the system has changed in a way that makes it incompatible with the binary the binary the file cannot be loaded any more. Maxima normally puts binary files it creates from its own packages in a folder named `binary` within the folder whose name it is printed after typing:

    (%i1) maxima_userdir;
    (%o1)                 /home/gunter/.maxima

If this directory is missing maxima will recreate it again as soon as it has to compile a package.

Categories: Error messages ·

Next: Only symbols can be bound, Previous: loadfile failed to load, Up: Error Messages [Contents][Index]

#### 101.1.8 makelist: second argument must evaluate to a number

`makelist` expects the second argument to be the name of the variable whose value is to be stepped. This time instead of the name of a still-undefined variable maxima has found something else, possibly a list or the name of a list.

Categories: Error messages ·

Next: Operators of arguments must all be the same, Previous: makelist second argument must evaluate to a number, Up: Error Messages [Contents][Index]

#### 101.1.9 Only symbols can be bound

The most probable cause for this error is that there was an attempt to either use a number or a variable whose numerical value is known as a loop counter.

Categories: Error messages ·

Next: out of memory, Previous: Only symbols can be bound, Up: Error Messages [Contents][Index]

#### 101.1.10 operators of arguments must all be the same

One possible reason for this error message to appear is a try to use `append` in order to add an equation to a list:

    (%i1) l:[a=1,b=2,c=3];
    (%o1)                 [a = 1, b = 2, c = 3]

    (%i2) append(l,d=5);
    append: operators of arguments must all be the same.
     -- an error. To debug this try: debugmode(true);

In order to add an equation to a list it has to be wrapped in a single-element list first:

    (%i1) l:[a=1,b=2,c=3];
    (%o1)                 [a = 1, b = 2, c = 3]

    (%i2) append(l,[d=5]);
    (%o2)             [a = 1, b = 2, c = 3, d = 5]

Categories: Error messages ·

Next: part fell off the end, Previous: Operators of arguments must all be the same, Up: Error Messages [Contents][Index]

#### 101.1.11 Out of memory

Lisp typically handles several types of memory containing at least one stack and a heap that contains user objects. To avoid running out of memory several approaches might be useful:

- If possible, the best solution normally is to use an algorithm that is more memory-efficient.
- Compiling a function might drastically reduce the amount of memory it needs.
- Arrays of a fixed type might be more memory-efficient than lists.
- If maxima is run by sbcl sbcl’s memory limit might be set to a value that is too low to solve the current problem. In this case the command-line option `--dynamic-space-size <n>` allows to tell sbcl to reserve `n` megabytes for the heap. It is to note, though, that sbcl has to handle several distinct types of memory and therefore might be able to only reserve about half of the available physical memory. Also note that 32-bit processes might only be able to access 2GB of physical memory.

Categories: Error messages ·

Next: undefined variable during plotting, Previous: out of memory, Up: Error Messages [Contents][Index]

#### 101.1.12 part: fell off the end

`part()` was used to access the `n`th item in something that has less than `n` items.

Categories: Error messages ·

Next: VTK is not installed, Previous: part fell off the end, Up: Error Messages [Contents][Index]

#### 101.1.13 undefined variable (draw or plot)

A function could not be plotted since it still contained a variable maxima doesn’t know the value of.

In order to find out which variable this could be it is sometimes helpful to temporarily replace the name of the drawing command (`draw2d`, `plot2d` or similar) by a random name (for example `ddraw2d`) that doesn’t coincide with the name of an existing function to make maxima print out what parameters the drawing command sees.

    (%i1) load("draw")$
    (%i2) f(x):=sin(omega*t);
    (%o2) f(x) := sin(omega t)
    (%i3) draw2d(
            explicit(
              f(x),
              x,1,10
            )
          );
    draw2d (explicit): non defined variable
     -- an error. To debug this try: debugmode(true);
    (%i4) ddraw2d(
            explicit(
              f(x),
              x,1,10
            )
          );
    (%o4) ddraw2d(explicit(sin(omega t), x, 1, 10))

Categories: Error messages ·

Previous: undefined variable during plotting, Up: Error Messages [Contents][Index]

#### 101.1.14 VTK is not installed, which is required for Scene

This might either mean that VTK is actually not installed - or cannot be found by maxima - or that Maxima has no write access to the temporary directory whose name is output if the following maxima command is entered:

    (%i1) maxima_tempdir;
    (%o1)                         /tmp

Note: The `scene()` command requires VTK with TCL/TK bindings.

Categories: Error messages ·

Previous: Error Messages, Up: Error and warning messages [Contents][Index]

### 101.2 Warning Messages

Next: replaced x by y, Previous: Warning Messages, Up: Warning Messages [Contents][Index]

#### 101.2.1 Encountered undefined variable `<x>` in translation

A function was compiled but the type of the variable `x` was not known. This means that the compiled command contains additional code that makes it retain all the flexibility maxima provides in respect to this variable. If `x` isn’t meant as a variable name but just a named option to a command prepending the named option by a single quote (`'`) should resolve this issue.

Categories: Error messages ·

Previous: undefined variable during translation, Up: Warning Messages [Contents][Index]

#### 101.2.2 Rat: replaced `<x>` by `<y> = <z>`

`rat` was called on an expression containing floating point numbers (including big floats) and `keepfloat` was false. This means the number was replaced by a rational number approximating the floating-point number.

See also `ratprint`, `ratepsilon`, `bftorat`, `fpprintprec` and `rationalize`.

Categories: Warning messages ·

Previous: undefined variable during translation, Up: Warning Messages [Contents][Index]