freenode/#sbcl - IRC Chatlog
Search
21:18:00
pfdietz32
Xach: the only portable way I can think of is to instrument defstruct via the macroexpand hook, so you can infer and record which functions are created.
22:06:47
Xach
pfdietz32: i don't care much about portability, sbcl-only would be great. i'm not seeing it.
23:59:39
jackdaniel
Xach: if you know the exact structure and you are looking only for slot readers, you could go with (sb-kernel:layout-slot-table (sb-kernel:find-layout 'foo)) and check for reader/writer functions if they match yours
0:03:34
jackdaniel
also, if you feel adventurous you should access the code-component (i.e via inspector) of the function, and if it is a function defined by defstruct, the layout will be in its constants
0:04:17
jackdaniel
so I suppose the way to go would be: access code component of the function and if there is a layout then try to access it and match with constructor and layout-slot-table functions
0:57:44
karlosz
doug gave the answer earlier, didn't he? (info :function :source-transform 'make-s) => (#<DEFSTRUCT-DESCRIPTION S {10019E1A93}> . :CONSTRUCTOR) given "(defstruct S)"
2:36:19
karlosz
hm, if you query the function name and get a defstruct-description object that means that it was certainly created in the defstruct