SourceForge has been redesigned. Learn more.
Close

#1150 function 'join' with non-list argument

closed
nobody
Lisp Core (471)
1
2007-03-20
2007-03-17
No

The user documentation says "Maxima complains if L_1 or L_2 is not a list." Not true:

(%i1) join([1,2,3],false);
(%o1) []

When Maxima does complain, it's not clear what's wrong:

(%i2) join([1,2,3],6);
Maxima encountered a Lisp error:
Error in MACSYMA-TOP-LEVEL [or a callee]: 6 is not of type LIST.

Discussion

  • Barton Willis

    Barton Willis - 2007-03-17

    Logged In: YES
    user_id=895922
    Originator: YES

    Fix:

    (defmfun $join (x y)
    (if (and ($listp x) ($listp y))
    (cons '(mlist) (loop for w in (cdr x) for u in (cdr y)
    collect w collect u))
    (merror "Both arguments to 'join' must be lists")))

     
  • Barton Willis

    Barton Willis - 2007-03-20

    Logged In: YES
    user_id=895922
    Originator: YES

    Fixed by plot CVS r 1.85

     
  • Barton Willis

    Barton Willis - 2007-03-20
    • status: open --> closed
     

Log in to post a comment.