freenode/#clasp - IRC Chatlog
Search
13:23:21
shiho
drmeister, Lisp closed when I run (energy:minimize *agg*). It was no problem before updating...
13:52:47
drmeister
I'm trying to pull everything together today. fastgf, generic function dispatch passing just the method arguments list and next methods, bind-va-list
14:05:39
beach
If the only applicable method is a slot accessor, you can do the access directly in the discriminating function without calling an effective method. But it requires some trickery as I recall.
14:05:40
drmeister
Yes - but the special circumstances where the optimization is allowed isn't recognized yet.
14:06:57
drmeister
I think all the trickery is in place - and the discriminating function compiler will generate special code for them.
14:06:58
drmeister
https://github.com/drmeister/clasp/blob/funclos/src/lisp/kernel/cmp/cmpfastgf.lsp#L564
14:07:20
drmeister
https://github.com/drmeister/clasp/blob/dev/src/lisp/kernel/cmp/cmpfastgf.lsp#L564
14:07:35
Bike
currently a generic function call takes like seven frames to get to the method from the generic, for non fastgf reasons, which is obviously not good
14:08:00
drmeister
Bike and I have to sit down and figure out where to figure out when and where we can insert these: 'core:optimized-slot-reader and 'core:optimized-slot-writer outcomes.
14:08:34
Bike
might have to look at effective method computation to make sure that if there's only one method it's used as the effective
14:09:16
Bike
have defmacro in one environment, compile defmacro defun, load that fasl in another environment with no defmacro, still works
14:12:15
Bike
you'd think after making as many repls as i have i'd remember that slime doesn't do well with completions in them, but no
14:13:43
drmeister
Bike: (bind-va-list lambda-list va-list-args . forms) is taking the place of (apply (lambda lambda-list . forms) va-list-args) - right?
17:09:32
specbot
ensure-generic-function-using-class: http://metamodular.com/CLOS-MOP/ensure-generic-function-using-class.html
20:26:59
drmeister
Clasp generates a lot of anonymous function objects - do other Common Lisp's have so many LAMBDA's?
20:27:21
drmeister
It sounds like a stupid question - but damn - there are a lot of lambdas in the backtrace.
20:29:02
drmeister
I added the core:lambda-name declaration years ago - with the hopes that I would name lambdas to avoid this - that didn't work out.
20:49:48
drmeister
The first thing above it that I could track was REGISTER-METHOD-WITH-SPECIALIZERS
20:55:40
drmeister
I thought it was some weird low-level problem - but that was a perfectly reasonable error except for the anonymous lambda part.
20:58:56
Bicyclidine
since you moved to fastgf and there's less stuff in C++, i can probably get into it now
21:46:15
Bike
well i see at least one weird thing, standard-compute-effective-method returns a function (&rest gf-args) if there's no primary method, but calls combine-method-functions otherwise, and that returns a method function (i.e. two arguments, a list of arguments and a list of next methods)
21:50:00
drmeister
I suspect it has something to do with function-to-method - maybe I need to use bind-va-list here as well?
21:52:17
Bike
the method-function gets a va-list .method-args., you apply the normal function to those args
21:55:15
Bike
i... don't understand. it's about to call this lambda from function-to-method, and you get a "3 args expected two" error?
21:55:51
Bike
you could put something in the function-to-method lambda that prints the function it's about to apply in the same way
21:57:21
drmeister
The 3 args are coming from an APPLY - I'm putting __attribute__((optnone)) on cl__apply
22:00:17
drmeister
I added this: (mlog "In function-to-method.lambda about to call %s with args %s\n" function (core:list-from-va-list .method-args.))
22:02:09
drmeister
In function-to-method.lambda about to call #<COMPILED-CLOSURE@0x10e6ef078 COMPUTE-EFFECTIVE-METHOD :ftype :FUNCTION lambda-list: (GF METHOD-COMBINATION APPLICABLE-METHODS) :fptr 0x110f5e2c0> with args (#S(STANDARD-GENERIC-FUNCTION CLASS-DIRECT-SUPERCLASSES #slots[11]) #S(METHOD-COMBINATION ) (#S(STANDARD-READER-METHOD ) #S(STANDARD-READER-METHOD )))
22:03:05
drmeister
I count three arguments in this lambda list (GF METHOD-COMBINATION APPLICABLE-METHODS)
22:05:23
Bike
note for later: the function calculate-discriminator-function is not used and incorrect
22:05:56
Bike
or, well, does compute-effective-method actually get called? maybe the problem is inside it
22:07:47
drmeister
#<COMPILED-CLOSURE@0x10ea5aa18 COMBINE-METHOD-FUNCTIONS3.LAMBDA :ftype :FUNCTION lambda-list: (.METHOD-ARGS. .NEXT-METHODS.) :fptr 0x11092a5a0>
22:09:19
drmeister
That's the message printed from within the (mlog "In combine-method-functions3.lambda - About to call method %s for gf %s\n" method gf)
22:09:56
drmeister
It's like it's trying to treat the method function returned by combine-method-functions3 as a regular function.
22:10:05
Bike
i mean i thought you said "In function-to-method.lambda about to call #<COMPILED-CLOSURE...>"
22:11:25
Bike
re earlier note: ignore, i was confused by cmpgf.lsp which has a codegen-dispatcher with differnet lambda list