(mapcan #'+ '(1 2 3 4 5)) ;=> 5

Bug #1577127 reported by Michał "phoe" Herda
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SBCL
Won't Fix
Undecided
Unassigned

Bug Description

Hey,

(mapcan #'+ '(1 2 3 4 5)) ;=> 5
According to the standard, this is equivalent to (apply #'nconc (mapcar #'+ '(1 2 3 4 5))), which throws an error.

Is this a bug in the standard, or the implementations? I've seen SBCL, CCL, ECL, CLISP all evaluate this to 5.

~phoe

Revision history for this message
Stas Boukarev (stassats) wrote :

It's not easy to efficiently signal an error in that case, yet have
(mapcan #'+ '(1)) or (mapcan #'identity '(nil nil 1)) return 1.

Changed in sbcl:
status: New → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.