freenode/#sicl - IRC Chatlog
Search
11:12:23
beach
OK, I'm confused. If the file compiler seeing a DEFCLASS has to create the class in the compilation environment, (so that FIND-CLASS will return it as the Common Lisp HyperSpec requires), then it appears to me that either
11:12:27
beach
1. the class created is not EQ to the one that will be created when the the compiled file is loaded,
11:12:33
beach
2. the file compiler has to create it in the startup environment instead of the compilation environment, or
11:12:35
beach
3. The startup environment or the compilation environment must be the same. I am not satisfied with any of these solutions.
11:41:05
Shinmera
1. seems to be the cleanest to me, and is definitely cleaner than option 4. don't make the class available in the compilation environment at all, which is what SBCL seems to do, if I recall correctly.
11:41:43
beach
Oh, 4 would be contrary to the requirement of the Common Lisp HyperSpec as I understand it.
11:43:21
jackdaniel
how about creating class prototype in compilation environment and promote it when it is loaded (if a prototype exists)? then eq will be preserved
11:48:27
beach
OK, I have a file to-delete.lisp containing (defclass bla () ()) (macrolet ((m (&environment env) (find-class 'bla env))) (m))
11:49:17
Shinmera
Sure, though it won't let me confirm whether, if find-class returns, it will be eq in the load env, so it needs a bit more
11:49:39
beach
Compiling it with SBCL signals an ERROR: (during macroexpansion of (M)) There is no class named COMMON-LISP-USER::BLA.
11:52:14
beach
Maybe (defparameter *c* '()) before compiling (so in the startup environment) and instead of (find-class 'bla env) I do (push (find-class 'bla env) *c*)?
11:54:13
beach
You need to save the return value of find-class at compilation time in the startup environment.
11:57:48
beach
Does everybody agree that the Common Lisp HyperSpec says that a class much be returned in my example?
12:17:58
Shinmera
beach: here's the results from the implementations I can run: https://plaster.tymoon.eu/view/1175#1175