Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MAPCAN/MAPCON Edge cases #445

Closed
Gleefre opened this issue May 9, 2023 · 2 comments
Closed

MAPCAN/MAPCON Edge cases #445

Gleefre opened this issue May 9, 2023 · 2 comments

Comments

@Gleefre
Copy link

Gleefre commented May 9, 2023

MAPCAN/MAPCON functions have two edge cases which are not correctly handled in ccl.

(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 ccl v1.12.1 (latest release)

@xrme
Copy link
Member

xrme commented Aug 10, 2023

There's extensive discussion of this at https://gitlab.common-lisp.net/cmucl/cmucl/-/issues/196

@xrme
Copy link
Member

xrme commented Sep 2, 2023

@gzacharias maybe you'd be interested in looking at this?

CCL and CMUCL share similar source code for mapcan and friends, but there are a few CCL alterations that look like they were authored by you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants