possible bug in compile-time hash-table initialization (Darwin 0.14-030417)

Ram Krishnan <[email protected]> Sat, 19 Apr 2003 19:58:04 -0700
Newsgroups gmane.lisp.openmcl.bugs
Message-ID <[email protected]>
I've run into a possible bug in 0.14-030417 when loading a .dfsl file 
in which a constant hash-table has been initialized at compile time. 
This is under Mac OS X 10.2.5.

The attached test code and dribble output are probably more informative.

Regards,

-ram

;; --- test.lisp ---
(in-package :cl-user)

(eval-when (:compile-toplevel)
   (defconstant +month-names-short-map+
     (let ((map (make-hash-table :test #'equal :size 12))
	  (short-names '#("jan" "feb" "mar" "apr" "may" "jun"
			  "jul" "aug" "sep" "oct" "nov" "dec")))
       (dotimes (i 12)
	(setf (gethash (aref short-names i) map) (1+ i)))
       map))
   )

(defun month-number-short (month-name)
   "Return the the month number (1-12) for the month named
MONTH-NAME. e.g:

  (month-number-short \"Mar\") => 3"
   (gethash month-name +month-names-short-map+))

#|
  (let ((*compile-print* t)
        (*load-print* t))
    (compile-file "home:src;commonlisp;test" :load t))
|#

;; --- dribble output ---
;Compiling "/Users/rkris/src/commonlisp/test.lisp"...
  Toplevel Forms...
  Toplevel Forms...
  Toplevel Forms...  (Compiletime, Loadtime)
  Toplevel Forms...
  +month-names-short-map+ [Defconstant]
  month-number-short
;Loading #4P"home:src;commonlisp;test.dfsl.newest"...
+month-names-short-map+
 > Error in process listener(2): Too few arguments in function call: 7 
provided, at least 8 required.
 > While executing: ccl::%cons-hash-table
 > Type :POP to abort.
Type :? for other options.
1 > :b
(F0268AA0) : 0 "ccl::%cons-hash-table" 0
(F0268AA0) : 1 nil nil
(F0268AA0) : 2 "ccl::call-check-regs" 80
(F0268AB0) : 3 "Anonymous Function #x502314E" 52
(F0268AC0) : 4 "ccl::%fasl-expr" 60
(F0268AD0) : 5 "Anonymous Function #x5023616" 44
(F0268AE0) : 6 "ccl::%fasl-expr" 60
(F0268AF0) : 7 "Anonymous Function #x5023256" 144
(F0268B00) : 8 "ccl::%fasl-expr" 60
(F0268B10) : 9 "Anonymous Function #x502339E" 60
(F0268B20) : 10 "ccl::%fasload" 892
(F0268B40) : 11 nil nil
(F0268B50) : 12 "ccl::attempt-load" 52
(F0268B60) : 13 "ccl::%load" 964
(F0268B80) : 14 nil nil
(F0268B90) : 15 "load" 652
(F0268BB0) : 16 "ccl::%compile-file" 1452
(F0268BC0) : 17 nil nil
(F0268BD0) : 18 "compile-file" 780
(F0268BF0) : 19 nil nil
(F0268C00) : 20 "Anonymous Function #x622F8FE" 84
(F0268C10) : 21 nil nil
(F0268C20) : 22 "ccl::toplevel-eval" 136
(F0268C30) : 23 "ccl::read-loop" 844
(F0268C70) : 24 "toplevel-loop" 52
(F0268C90) : 25 "Anonymous Function #x50EC406" 120
(F0268CA0) : 26 nil nil
(F0268CB0) : 27 "Anonymous Function #x511A24E" 208
(F0268CD0) : 28 "ccl::run-process-initial-form" 348
(F0268D20) : 29 nil nil
(F0268D30) : 30 "Anonymous Function #x50E2576" 132
(F0268D50) : 31 nil nil
(F0268D60) : 32 "Anonymous Function #x50D94A6" 140
1 >