[Ecls-list] LOAD-TIME-VALUE and literal object externalisation.
Juan Jose Garcia-Ripoll
jjgarcia at users.sourceforge.net
Wed Apr 23 13:56:23 UTC 2008
There are several issues here. Let's go one by one.
First, the compiler gets code in the form of lists. When the ANSI Spec
says that an object is externalizable when it can be a literal in the
code, it does not refer to the printed representation that you store
in a source file. It refers to the list that COMPILE uses or which
COMPILE-FILE reads. So, for instance, the following is perfectly
(defun my-hashtable (x) #.(make-hash-table))
Note that is legal because ANSI defines rules for the similarity of
hash tables and thus establishes that hash tables can be exported to
compiled (binary in my previous emails) files. Hence, I should fix ECL
to make this possible.
Regarding functions, they can not be literals in compiled code. When
you use something like
(defun my-function (x) #'(lambda (y) (+ x y)))
this does not include the function as a literal, but provides a
special form that may construct it. The fact that I allowed
bytecode-compiled functions to be included as literals in the code is
an extension exclusively from ECL, which is permitted because of two
strategic issues 1) bytecode-compiled functions already have a
readable printed representation and 2) it is useful for making some
compiled files smaller.
So, summing up:
1) I have to fix ECL to also externalize hash tables
2) Abitrary functions can not be externalized into compiled files.
Facultad de Fisicas, Universidad Complutense,
Ciudad Universitaria s/n Madrid 28040 (Spain)
More information about the ecl-devel