POSITION miscompiles on a constant sequence containing OTHERWISE

Bug #1863004 reported by Paul F. Dietz
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SBCL
Fix Released
Undecided
Unassigned

Bug Description

(funcall (lambda (x) (position x '(a otherwise b))) 'a)

==>

Execution of a form compiled with errors.
Form:
  (CASE SB-C::ITEM (A 0) (OTHERWISE 1) (B 2))
Compile-time error:
  during macroexpansion of (CASE SB-C::ITEM (A 0) ...). Use *BREAK-ON-SIGNALS* to
intercept.

 Bad CASE clause:
   (OTHERWISE 1)
 OTHERWISE allowed as the key designator only in the final otherwise-clause,
 not in a normal-clause. Use (OTHERWISE) instead, or move the clause to the
 correct position.
See also:
  The ANSI Standard, Macro CASE
   [Condition of type SB-INT:COMPILED-PROGRAM-ERROR]

Restarts:
 0: [ABORT] Exit debugger, returning to top level.

Backtrace:
  0: ((LAMBDA (X)) #<unused argument>)
  1: (SB-INT:SIMPLE-EVAL-IN-LEXENV (FUNCALL (LAMBDA (X) (POSITION X #)) (QUOTE A)) #<NULL-LEXENV>)
  2: (EVAL (FUNCALL (LAMBDA (X) (POSITION X #)) (QUOTE A)))
 [...]

Stas Boukarev (stassats)
Changed in sbcl:
status: New → Fix Committed
Stas Boukarev (stassats)
Changed in sbcl:
status: Fix Committed → Fix Released
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.