freenode/#clasp - IRC Chatlog
Search
2:26:25
drmeister
So you could compile fast-effective-method to an llvm-ir function that accepts a closure, number of arguments and two arguments and then in the discriminator you call foo(closure,2,x,y) and then inline the first function at that call site.
2:28:03
Bike
if there are effective methods, they just get the arguments to the gf and maybe the gf as arguments
2:29:45
drmeister
The general Clasp calling convention is foo(closure,num-args,farg0,farg1,farg2,farg3,...)
2:30:35
Bike
the effective method function is pretty special purpose and we basically want it to be inlined, so i don't see any need to conform to practically anything if it doesn't have to
2:32:35
Bike
an effective method is certainly not a closure, the clhs is even weirdly explicit about what's in its environment
2:33:30
drmeister
A closure is an environment and a function. When the function is called it is passed its environment.
2:35:54
Bike
and potentially whatever the user specifies but that's exotic and underspecified so i'm not worried about it
2:37:08
Bike
"When a method is actually called by an effective method, its first argument will be a list of the arguments to the generic function. Its remaining arguments will be all but the first argument passed to call-method."
2:37:48
Bike
but i'm not too worried about it because the closer mop guy wrote a paper about how much this sucks
2:40:01
Bike
i mean, there are a few other problematic things, like here call-next-method gets actual methods in the next-methods, but both clasp and sicl pass the method functions
2:59:36
Bike
anyway, if we're smarter with the result of compute-effective-method, we can use the fact that call-method is a macro but gets actual methods as argument to flexibly change the method invocation protocol
3:31:13
Bike
actually i guess method functions can be closures, if nothing else you can provide it manually