[Ecls-list] LOAD-TIME-VALUE and literal object externalisation.

Samium Gromoff _deepfire at feelingofgreen.ru
Mon Apr 14 08:56:36 UTC 2008


At Sun, 13 Apr 2008 10:53:57 +0200,
Juan Jose Garcia-Ripoll wrote:
> On Fri, Apr 11, 2008 at 12:27 PM, Samium Gromoff
> <_deepfire at feelingofgreen.ru> wrote:
> >  So, here's the test case:
> >  (eval-when (:compile-toplevel :load-toplevel :execute)
> >   (defparameter foo (lambda ())))
> >
> >  (load-time-value foo)
> >
> >  deepfire at canopus:~/local/mdb$ ecl -eval '(compile-file "foo.lisp")'
> >  ;;; Loading #P"/usr/lib/ecl/cmp.fas"
> >  ;;; Loading #P"/usr/lib/ecl/sysfun.lsp"
> >  ;;; Compiling foo.lisp.
> >  ;;; Compiling (DEFPARAMETER FOO ...).
> >  An error occurred during initialization:
> >  Object #<bytecompiled-function 08091af0> cannot be externalized.
> 
> Thanks for reporting this bug. LOAD-TIME-VALUE was unfortunately coded
> so as to handle properly lists and objects other than symbols. I had
> not contemplated the possibility of using global variables. That
> produced all problems.

The scenario above works now, but when I attempt to actually use the value
it reappears:

(eval-when (:compile-toplevel :load-toplevel :execute)
  (defparameter foo (lambda ())))

(funcall (load-time-value foo))

deepfire at canopus:~/local$ ecl -eval '(compile-file "foo.lisp")'
;;; Loading #P"/usr/lib/ecl/cmp.fas"
;;; Loading #P"/usr/lib/ecl/sysfun.lsp"
;;; Compiling foo.lisp.
;;; Compiling (DEFPARAMETER FOO ...).
An error occurred during initialization:
Object #<bytecompiled-function 0838cbb8> cannot be externalized.


regards, Samium Gromoff




More information about the ecl-devel mailing list