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

#### 97.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: cannot assign to function, Previous: No such list element, Up: Error Messages [Contents][Index]