freenode/#sicl - IRC Chatlog
Search
11:51:41
beach
I had an idea yesterday about implementing EQUAL and EQUALP hash tables. I was thinking that one could create an automaton that destructures the keys that are CONS cells, and that use more primitive tests for other objects. I suspect that would be faster than computing a hash function and then, perhaps repeatedly, call EQUAL or EQUALP on the keys.
12:44:00
beach
For the "leaves", it could either use an EQL hash table, or binary search, depending on the number of keys.
12:45:13
beach
The automaton would be dynamically generated as nested tests, and the compiled by the compiler.
12:47:14
heisig
Do I understand correctly that this automaton has to be recomputed whenever new keys are added? (Modulo caching, laziness)
12:47:41
beach
Well, when only a few keys are added, they could be tested for first, before the automaton is consulted.
12:48:26
beach
Also, if several keys are added, but there are no queries, there is no reason to create the automaton.
12:50:26
jcowan
Presumably you can use the rehash threshold to decide when to recompute the automaton.
12:58:43
jcowan
Is there a portable way with defpackage to inherit from exactly zero packages, short of using unuse-package? The CLHS says that if :use is omitted you get the default packages, but is silent about what (:use) does. I know that works in sbcl, but what about other implementations
13:03:11
pfdietz
In analogy to the :use argument of make-package: the default to a keyword argument is used only when the keyword arg is absent, not when it's present with the value NIL.
13:04:32
jcowan
Okay, thanks. I want to cherry-pick only certain symbols from the CL package with import and shadow others.
15:23:42
beach
I am getting tired after a long day of work on bootstrapping, so I think I might only do lightweight stuff for the rest of the day. I did make considerable progress with making phases 2 and 3 similar.
15:24:11
beach
I also eliminated some bootstrapping-specific code in favor of loading files containing production code.
15:25:57
beach
There are a bunch of chunks of code that have a similar structure: import some functions from the host that are need, then load three files, one for support code, one for DEFGENERIC forms and one for DEFMETHOD forms. I am working on extracting each of these chunks to a function and giving that function a significant name.
15:26:45
beach
Such a function typically takes an environment as its argument, so it should be possible to reuse between phases.
15:34:25
beach
I did have one amusing experience. I convinced myself that the code for ADD-DIRECT-METHOD and REMOVE-DIRECT-METHOD could work when loaded into one single environment, in that it will receive arguments of the right type for that environment.
15:34:34
beach
Still, I had a failure much later in the code when I loaded method definitions for ENSURE-CLASS-USING-CLASS. It turns out that one of the methods on ENSURE-CLASS-USING-CLASS has NULL as one specializer, and I did not define the NULL class, so FIND-CLASS returned NIL.
15:34:37
beach
Tomorrow, I will add code for defining classes SEQUENCE, LIST, SYMBOL and NULL, and the accessor generic functions SYMBOL-NAME and SYMBOL-PACKAGE so that I can again load all the methods on ENSURE-CLASS-USING-CLASS.
15:35:28
beach
Once I have SYMBOL, I can define MAKE-INSTANCE normally, without any special-purpose code, or that's what I am hoping.
15:38:52
heisig
Heh, what an interesting bug. I think it would be easiest to define all built-in classes directly during bootstrapping and not in the individual SICL modules.
15:39:29
beach
Those are not mutually exclusive. I just load the file in the module during bootstrapping.
15:40:34
beach
I mean, I can't use ASDF during bootstrapping anyway, so I load those files explicitly in the bootstrapping code.
17:20:46
beach
I decided not to wait until tomorrow with loading all those class definitions. In the process I found a few bugs in my class definitions. I had left out the (empty) list of slots in a few definitions.