libera/#commonlisp - IRC Chatlog
Search
13:33:43
pjb
It' strange that compiler-macro-function takes an environment parameter, but it can only be NIL for (setf compiler-macro-function).
13:38:07
Bike
compiler-macro-function needs it because compiler macros can be shadowed by local functions
13:38:22
Bike
but also, typep and subtypep and find-class take environment parameters, and there's no concept of local types
13:39:44
beach
Can those just be different global environments, like the ones mentioned for file compilation?
13:43:47
beach
So it looks like DEFTYPE can be defined in the compilation environment, so the environment to TYPEP and SUBTYPEP could be a compilation environment.
13:45:15
jackdaniel
could it be that find-class when used with compilation environment yields a forward referenced class instance standing for a class that is defined in this compilation unit?
13:52:49
pjb
Bike: oh I see, so with a lexical environment compiler-macro-function could return NIL because its (global) function is shadowed.
13:53:28
pjb
The magic of a specification: if you use it to implement something, it works even if you don't understand it! :-)
14:01:36
beach
So does that mean that DEFCLASS always defines the class in the evaluation environment?
14:01:37
jackdaniel
fwiw mcclim does a funny thing: it records presentations at compile time and tries to attach them to functions at run time (because as you have noted it may be a different class by then :)
14:03:30
Bike
what clasp does now is note any accessors in a similar way to what it does for defuns, and then sets an internal "class-info" in the environment, which covers the stuff where later sub/typep calls need to recognize it as a type, etc
14:05:14
beach
An environment parameter of a macro is always going to be the compilation environment, and the compilation environment inherits from the evaluation environment.
14:05:35
beach
So if the class is defined in the evaluation environment, that makes the phrase in the Common Lisp HyperSpec make sense.
14:06:14
beach
But my hypothesis is that the wording of the Common Lisp HyperSpec means that it always is.
14:07:32
Bike
evaluating defclass forms at compile time at all can cause issues. people do things like put a defclass form and a related validate-superclass method definition in the same file.
14:08:18
beach
I am not saying it is a good idea. I am just speculating about the meaning of the wording in the Common Lisp HyperSpec.
14:09:54
beach
It could be a forward-referenced-class as jackdaniel suggests. Nothing is said about the utility of the class at compile time. Just that FIND-CLASS must return it.
14:09:55
Bike
https://github.com/clasp-developers/clasp/issues/926 e.g. here's an issue we hit with clim
14:09:56
jackdaniel
wouldn't evaluating (%compiler-defclass-using-internals-but-preserving-identity …) in the compilation environment suffice?
14:14:51
jackdaniel
beach: that there is no need to evaluate defclass at all, it is enough for the compiler to take a note and return something sensible from find-class
14:15:33
jackdaniel
(i.e if find-class is not called, then not define a class at all; and if it is called with the compiler environment make an instance of a forward-referenced class)
14:16:50
Bike
i think the main thing is i don't understand what you're supposed to be able to do with a find-class result, if anything
14:17:05
Bike
can you even do subtypep and stuff with it? couldn't the set of superclasses be affected by mop methods?
14:40:36
jackdaniel
i.e (if (find-class 'foo nil cmp-env) `(fast-something ,obj) `(slow-something (make-wrapper ,obj)))
14:42:10
beach
And in that case, just associating the name with a new forward-referenced-class in the evaluation environment will work.
17:45:03
jcowan
I'm wondering why nobody has implemented a CL in which COMPILE-FILE is done by compiling to C. It's been done several times for Scheme, and Scheme's control structure is much more un-C-ish than CL's.
17:57:15
jcowan
I didn't know about molybdenum chloride. Forgetting the KCL family (KCL/AKCL/GCL/ECL) was a brain fart. I can't find anything named CLOCC except a code library
18:18:09
gigamonkey
Do I need to care about these warnings from ASDF: Please only define "flexi-streams" and secondary systems with a name starting with "flexi-streams/"
18:35:20
Krystof
(I don't actually know, I'm just impressed that a warning says "please" more than my children do)
18:42:53
gigamonkey
Krystof: is this just ASDF being opinionated and various libraries not sharing the opinion?
18:49:23
etimmons
gigamonkey: Pretty much. ASDF wants that naming scheme so that it can map system names to an .asd file.
18:49:46
jackdaniel
gigamonkey: there is a deeper reasoning behind that -- say that asdf doesn't know anything about the system - then when you type (asdf:load-system "flexi-streams.foo") it will look for the file flexi-streams.foo.asd
18:50:04
etimmons
Most projects have adapted, but some steadfastly refuse. I think flexi-streams is in the latter camp.
18:50:32
jackdaniel
that said, when you have flexi-streams.test that is loaded only after flexi-streams, then asdf knows where the system is defined, because it already has loaded flexi-streams.asd
21:50:35
moon-child
alternately use an rng that can be advanced arbitrarily, and advance it the number of days since some epoch
22:01:57
mfiano
Not really. 5489 is used as an example for a bunch of MT implementations it looks like
22:03:42
jmercouris
unfortunately when you restart CL, the seed is of course different, so I'll have to use the SBCL extension if I really want it to work
22:05:54
jmercouris
it's just that I'm putting this in my Nyxt init file, which doesn't have privileges to fetch from QL
22:09:06
edgar-rft
jmercouris: why can't you download the stuff with QL and then copy it into your Nyxt init file?