Bug#665896: cmucl: Compiler gives incorrect error if T clause in case construct is not last one

Faheem Mitha faheem at faheem.info
Mon Mar 26 20:25:24 UTC 2012


Package: cmucl
Version: 20c-2
Severity: normal


I would report this to the cmucl bug tracking system at
http://trac.common-lisp.net/cmucl/report but I could not figure out
how to create an account. If you can tell me, I'll create a bug report
there. See the related bug report
https://bugs.launchpad.net/sbcl/+bug/959687

CMUCL does give an error, but I believe the error message is
incorrect. It says

; Error in function LISP::CASE-BODY:
;    T and OTHERWISE may not be used as key designators for CASE

But it can, it just needs to be the last clause.

BTW, all the stuff using clc: is out of date and should be
removed/altered.

                                                 Regards, Faheem

faheem at orwell[default branch:rev 926]:~/corrmodel/doc$ cmucl
CMU Common Lisp Debian build debian/20c-2-1-g957a42a-dirty (20C Unicode), running on orwell
With core: /usr/lib/cmucl/lisp-sse2.core
Dumped on: Mon, 2012-01-23 17:34:46+05:30 on manticore
See <http://www.cons.org/cmucl/> for support information.
Loaded subsystems:
    Unicode 1.28 with Unicode version 6.0.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]

-- System Information:
Debian Release: 6.0.4
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable'), (50, 'unstable'), (50, 'testing'), (1, 'experimental')
Architecture: i386 (i686)

Kernel: Linux 2.6.32-5-vserver-686-bigmem (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages cmucl depends on:
ii  debconf [debconf-2.0]         1.5.36.1   Debian configuration management sy
ii  libc6                         2.11.3-3   Embedded GNU C Library: Shared lib

Versions of packages cmucl recommends:
ii  binfmt-support                1.2.18     Support for extra binary formats

Versions of packages cmucl suggests:
pn  cmucl-docs                    <none>     (no description available)
pn  cmucl-source                  <none>     (no description available)
pn  ilisp                         <none>     (no description available)

-- Configuration Files:
/etc/common-lisp/cmucl/site-init.lisp changed:
;;; -*- Mode: Lisp; Package: System -*-
;;;
;;; **********************************************************************
;;; This code was written as part of the CMU Common Lisp project at
;;; Carnegie Mellon University, and has been placed in the public domain.
;;;
;;; Heavy modifications by Peter Van Eynde
(in-package "SYSTEM")
(if (probe-file "/etc/lisp-config.lisp")
    (load "/etc/lisp-config.lisp")
  (format t "~%;;; Hey: there is no /etc/lisp-config.lisp file, please run \"dpkg-reconfigure common-lisp-controller\" as root"))
;;; If you have sources installed on your system, un-comment the following form
;;; and change it to point to the source location.  This will allow the Hemlock
;;; "Edit Definition" command and the debugger to find sources for functions in
;;; the core.
(setf (ext:search-list "target:")
      '(
        "/usr/share/common-lisp/source/cmucl/"      ; object dir
        ))
(setf (ext:search-list "library:") '("/usr/lib/cmucl/"))
;;; for safety...
;;; optional extentions to the lisp image: delete if you
;;; don't like them :-).
(in-package :common-lisp-user)
;;; newbie functions, delete if you don't like them
(defun help ()
  (format t "~
Welcome to CMUCL for Linux.
If you aren't running this with ilisp in emacs,
or aren't intending to use hemlock then you
deserve to lose. :-)
Read the documentation in /usr/share/doc/cmucl.
(quit) is to quit.
(ed) starts hemlock (if installed)
(demo) shows a list of demos
(describe 'progn) gives information about progn for
 example.
(inspect '*a*) interactively inspects *a* for example.
"))
(defun demo ()
  (format t "Some demos are in the source package, some in the
normal package.
General demos:
CLX demos:
 (require :clx)
 (load \"/usr/share/common-lisp/source/cmucl-clx/demo/hello.lisp\")

 (xlib::hello-world \"\")
 (load \"/usr/share/common-lisp/source/cmucl-clx/demo/menu.lisp\")
 (xlib::just-say-lisp \"\")
 (xlib::pop-up \"\"
	       '(\"Linux\" \"FreeBSD\" \"OpenBSD\"))
  exit by pressing control+C followed by a keypress.
Clue demos:
 if you have installed the clue package you can do:
 (clc:clc-require :clue)
 (load \"/usr/share/common-lisp/source/clue/examples/menu\")
 (clue-examples::beatlemenuia \"\")
 (clue-examples::pick-one \"\"
			  \"One\"
			  \"Two\"
			  \"Three\")
 (clue-examples::just-say-lisp \"\")

 or you can use the Clio demos:
 (clc:clc-require :clio)
 (clc:clc-require :clio-examples)
 (clio-examples::sketch :host  \"\")
Pictures demos:
 (clc:clc-require :pictures)
 (load \"/usr/share/common-lisp/source/pictures/examples/road-demo\")
 (pictures::road-demo)
 press control-a to animate
"))


-- debconf information:
  cmucl/upgradeproblems:





More information about the pkg-common-lisp-devel mailing list