MAPCAN/MAPCON functions have two edge cases which are not correctly handled in clisp.
(mapcan #'identity '(1 2 3)) ; should error, returns 3 instead
(mapcon #'car '(1 2 3)) ; same
(setf *print-circle* t)
;; This returns #1=(1 2 . #1#), which is correct
(let ((lst (list 1 2)))
(flet ((f (x)
(declare (ignore x))
lst))
(apply #'nconc (mapcar #'f '(1 2)))))
;; Should be equivalent to the previous example, but hangs instead.
(let ((lst (list 1 2)))
(flet ((f (x)
(declare (ignore x))
lst))
(mapcan #'f '(1 2))))
Also please see https://gitlab.common-lisp.net/ansi-test/ansi-test/-/issues/39 .
Tested on clisp 2.49:
[1]> (lisp-implementation-version)
"2.49.93+ (2018-02-18) (built on lcy02-amd64-055.buildd [127.0.1.1])"
I agree with at least the first part of your example: NCONC should validate that its arguments except the last one are lists. MAPCAN and MAPCON should check the intermediate results accordingly.