Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • cmucl cmucl
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 56
    • Issues 56
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 8
    • Merge requests 8
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • cmucl
  • cmuclcmucl
  • Issues
  • #5
Closed
Open
Issue created Jun 06, 2015 by Peter Van Eynde@pvaneynde

Compiler gives incorrect error if T clause in case construct is not last one

Hi,

This is a debian bug 665896 and applies to 20c:

$ cmucl
CMU Common Lisp Debian build  (20F Unicode), running on frost
With core: /usr/lib/cmucl/lisp-sse2.core
Dumped on: Thu, 2015-06-04 10:35:42+02:00 on rootfs
See <http://www.cmucl.org/> for support information.
Loaded subsystems:
    Unicode 1.29 with Unicode version 6.2.0
    Python 1.1, target Intel x86/sse2
    CLOS based on Gerd's PCL 2010/03/19 15:19:03
* (defparameter x 2)

X
* (defun foo (y) (case y (t (print "matches t")) (1 (print "matches 1"))))

FOO
* (foo x)

; In: LAMBDA (Y)

;   (CASE Y (T #) (1 #))
; Error: (during macroexpansion)
;
; Error in function LISP::CASE-BODY:
;    T and OTHERWISE may not be used as key designators for CASE
;
;   #'(LAMBDA (Y) (BLOCK FOO #))
; Note: Variable Y defined but never used.

Execution of a form compiled with errors:
 (CASE Y (T (PRINT "matches t")) (1 (PRINT "matches 1")))
   [Condition of type KERNEL:SIMPLE-PROGRAM-ERROR]

Restarts:
  0: [ABORT] Return to Top-Level.

Debug  (type H for help)

(FOO #<unused-arg>)
Source: (BLOCK FOO (CASE Y (T #) (1 #)))
0]

This problem was handled by sbcl as 959687.

Assignee
Assign to
Time tracking