freenode/#clasp - IRC Chatlog
Search
17:13:04
stassats
(compile nil #'documentation) => COMPILE doesn't know how to handle this type of function
17:15:34
stassats
i remember this being a stopper for ansi-tests, so it was just swept under the rug
17:17:52
stassats
it does (compile 'documentation), which no longer fails, but isn't actually doing anything
17:18:58
Bike
because... compiled-function is a class... and generic function isn't a subclass of it, or something
17:21:48
Bike
apparently print-unreadable-object returns nil, that makes the clhs example wrong since print-object doesn't return the object. nice
17:23:35
stassats
(let ((fun (make-instance 'sb-mop:funcallable-standard-object)) (sb-ext:*evaluator-mode* :interpret)) (sb-pcl:set-funcallable-instance-function fun (eval '(lambda ()))) (typep fun 'compiled-function)) => T
17:27:37
stassats
compiled-function in sbcl is defined as (sb!xc:deftype compiled-function () '(and function (not sb!eval:interpreted-function)))
17:39:37
Bike
as far as i can tell from the source, write only calls print-object on instances, and classes are not instances, so there's that mystery solved i guess
4:30:47
Bike
er, maybe i'm misremembering. the thing with turning generic functions into things that have behavior for all possible argument dispatches
4:32:31
Bike
anyway, i wrote a method class and function that can do everything an effective method does (unless it has a really weird method combination, because i'm not clear on those details
4:35:49
Bike
But, I mean you can get a regular function that takes the same parameters as the generic function, and does its behavior (without dispatching)
4:37:54
beach
I see. Well, drmeister thinks that turning a generic function into a function is related to satiation, but it isn't. That idea comes from phoe and it has no name (yet).
4:38:30
Bike
I thought satiation was to take care of things so you could load fasls into an image without CLOS.
4:38:33
beach
So you are not just turning an effective method into a function, but the entire generic function?
4:39:08
Bike
no, just an effective method. you basically do (multiple-value-call #'static-effective-method (compute-effective-method ...))
4:42:49
Bike
effective-method returns a form made of call-method and make-method, which are local macros.
4:44:05
Bike
compute- i mean. Like, if there's only one primary method and it's standard method combination you get back (call-method #<METHOD> ())
4:46:13
Bike
i'm thinking of optimizations i can do with make-instance so i'm getting deep into mop stuff for a bit
4:46:31
beach
I am sure it is, and I am just not understanding what it is you did and how it is related to satiation.
4:49:11
Bike
You can do (eval (static-effective-method (mop:compute-effective-method gf mc methods) nil)) and get back a normal function f such that (gf ...) and (f ...) do the same thing, if the ... have the same applicable methods as passed to compute-effective-method.
4:50:45
beach
But you are saying that a single effective method does what the generic function does.
4:51:09
Bike
nono, that's what the "if" is supposed to mean. if the arguments to the gf had different applicable methods the static method won't work.
4:51:13
beach
Despite my asking before whether you turn the entire generic function into a function.
4:52:22
Bike
it's all pretty confusing, but i think i can use this. plus using make-method-lambda was surprisingly non painful
4:56:08
beach
I think it is good that you are looking into the MOP. Don't hesitate to look at the CLOS directory of SICL, or to contribute to it.