Sequence functions and circular arguments

Bug #309144 reported by Nikodemus Siivola
2
Affects Status Importance Assigned to Milestone
SBCL
Confirmed
Low
Unassigned

Bug Description

  COERCE, MERGE and CONCATENATE go into an infinite loop when given
  circular arguments; it would be good for the user if they could be
  given an error instead (ANSI 17.1.1 allows this behaviour on the part
  of the implementation, as conforming code cannot give non-proper
  sequences to these functions. MAP also has this problem (and
  solution), though arguably the convenience of being able to do
    (MAP 'LIST '+ FOO '#1=(1 . #1#))
  might be classed as more important (though signalling an error when
  all of the arguments are circular is probably desireable).

Tags: sequences
Changed in sbcl:
importance: Undecided → Low
status: New → Confirmed
Revision history for this message
jobach (form-t) wrote :

REDUCE has the same problem, even if one gives end explicit value for :END (say n).
Mayby it might be reasonable to to process n elements (instead of signaling an error or looping infinitly)
when :END is given.

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.