Re: quote vs load-time-value in compile-file

"Jerry Boetje" <jboetje@xxxxxxxxxxx> writes:

I've been working on the CLforJava compiler, and I've come upon an
interesting question while (file) compiling the QUOTE form. If I find
the form '(a b c), I have to generate code to reconstitute the quoted
list - something like (list (intern "A") (intern "B") (intern "C")).
Life gets more interesting if I have a quoted list that looks like '(a
#.(make-foo :x 2 :y 3) b). This of course is supposed to reconstituted
to (a #s(FOO :x 2 :y 3) b).

Only in the presence of a suitable definition for MAKE-LOAD-FORM.

So again I have to create code to re-create
this, say (list (intern "A") (make-foo :x 2 :y 3) (intern "B")).

But this seems that, in the compilation environment, I could transform
the '(a b) form into (load-time-value (list (intern "A") (intern "B")).
I'd love to morph quote into l-t-v. But am I missing some particular
sematics? thanks for the assist.

I think that understanding MAKE-LOAD-FORM will probably clear up the
issue that you have. Basically, it's the user's responsibility to
tell the compiler how to dump literal objects.


Relevant Pages