[cmucl-imp] A LOAD-TIME-VALUE/MAKE-INSTANCE bug
[nikodemus@delirium:~/tmp]
> cat bug1.lisp
(defclass c1 ()
())
(defun a-c1 ()
(load-time-value (make-instance 'c1)))
[nikodemus@delirium:~/tmp]
> lisp -init /dev/null
; Loading #P"/dev/null".
CMU Common Lisp 20c release-20c (20C Unicode), running on delirium
With core: /usr/local/lib/cmucl/lib/lisp-sse2.core
Dumped on: Thu, 2011-11-03 06:58:17+02:00 on gondor.local
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
* (load (compile-file "bug1.lisp"))
; Python version 1.1, VM version Intel x86/sse2 on 2011-12-01 13:14:19.
; Compiling: /Users/nikodemus/tmp/bug1.lisp 2011-12-01 13:13:33
; Compiling Load Time Value of (PCL::ENSURE-CTOR '(PCL::CTOR C1) 'C1 ...):
; Compiling Load Time Value of (MAKE-INSTANCE 'C1):
; Converted A-C1.
; Compiling DEFUN A-C1:
; Byte Compiling Top-Level Form:
; bug1.sse2f written.
; Compilation finished in 0:00:00.
; Loading #P"/Users/nikodemus/tmp/bug1.sse2f".
Error in function PCL::FIND-CLASS-FROM-CELL: No class named C1.
[Condition of type SIMPLE-ERROR]
Restarts:
0: [CONTINUE] Return NIL from load of #P"/Users/nikodemus/tmp/bug1.sse2f".
1: [ABORT ] Return to Top-Level.
Debug (type H for help)
(PCL::FIND-CLASS-FROM-CELL C1 NIL T)
Source: Error finding source:
Error in function DEBUG::GET-FILE-TOP-LEVEL-FORM: Source file no longer exists:
target:pcl/macros.lisp.
0]
Cheers,
-- Nikodemus
* Nikodemus Siivola [2011-12-01 11:17] writes:
Error in function PCL::FIND-CLASS-FROM-CELL: No class named C1. [Condition of type SIMPLE-ERROR]
It think the spec doesn't require that c1 is defined at the time when the load-time-form is evaluated. Specifically, it says this: It is guaranteed that the evaluation of form will take place only once when the file is loaded, but the order of evaluation with respect to the evaluation of top level forms in the file is implementation-dependent. Helmut
On 1 December 2011 13:30, Helmut Eller <heller@common-lisp.net> wrote:
It think the spec doesn't require that c1 is defined at the time when the load-time-form is evaluated. Specifically, it says this:
It is guaranteed that the evaluation of form will take place only once when the file is loaded, but the order of evaluation with respect to the evaluation of top level forms in the file is implementation-dependent.
Wow. Never noticed that. That's actually a pretty cool provision. Cheers, -- nikodemus
participants (2)
-
Helmut Eller -
Nikodemus Siivola