freenode/#sbcl - IRC Chatlog
Search
7:06:21
flip214
https://github.com/phmarek/sbcl/tree/no-applicable-method, the no-applicable-method/ directory.
7:07:00
flip214
basically, I'm changing a DEFSTRUCT; ASDF says the method is newly compiled (and loaded?!)
7:19:36
flip214
if you read the logfile, you can see that the GF call in file3.lisp _does_ work as expected.
7:20:14
|3b|
well, pretty sure redefining structures is undefined per spec, so technically conformant behavior :)
7:23:49
flip214
the second time through the file the structure is no longer different, and compilation continues
7:24:38
flip214
but that would've required cutting it into the 4 pieces, and I thought the GIT way is easier to follow.
7:24:56
flip214
seems I should've left the comments in, and not rely only on my few text lines here.
7:39:18
|3b|
flip214: if you remove the call to do-that from the file, does it work on repl? or if you add another call to the file, do both work?
7:40:28
|3b|
ACTION tried something similarly just interactively, and calling gf after redefining struct and method worked once but not 2nd time with no changes in between
7:43:05
flip214
the interesting thing is that inspecting the GF shows that it still has the method for a FOO class
7:43:56
flip214
but thanks a lot for acknowledging that it seems to be an SBCL bug, and not (directly) my fault!
7:47:01
flip214
as structures are just classes in sbcl anyway, and redefining classes is supported, this looks strange, though
7:47:39
flip214
|3b|: well, the compiler itself says that the method is newly compiled - so it should get the new structure type!
7:47:53
|3b|
ACTION wonders if undefined behavior is allowed to be contagious through .fasls... it is allowed to save any random garbage it wants in first session, but presumably the new session should refuse to load bad fasl files
7:51:06
flip214
|3b|: well, the inspector says the parent classes are Class: {[1] #<STANDARD-CLASS COMMON-LISP:STRUCTURE-CLASS> []}
7:52:34
|3b|
right, but i think structure-class and standard-class have different rules (no idea if any of them apply here)
7:54:00
flip214
If I change DEFSTRUCT to DEFCLASS and add the MAKE-FOO function this works as expected.
7:58:10
|3b|
yeah, looks like adding another method after the method makes it recalculate whatever is broken, and calling the method on the struct works
7:59:20
knobo
flip214: is that because memory address is used as value for eq? or is it any other reason?
8:08:34
flip214
knobo: I guess it's much easier and faster if eg. code keeps its address - then functions don't have to do indirect calls after a GC.