freenode/#lisp - IRC Chatlog
Search
12:24:56
VincentVega
Hmm, why does closer-mop:slot-definition-writers accept only a direct-slot-definition as an argument? What if I have a derived class and want to see writers for an inherited slot?
12:28:25
jmercouris
I don't understand why it cannot find that which exists, do I hvae the repository wrong? the signature wrong?
12:29:09
jmercouris
VincentVega: perhaps you will have to go up the inheritance tree and query the object which has the slot itself
12:32:09
VincentVega
jmercouris: well, that could be a solution, but I am wondering what's the reason for this, because it's weird to see this work
12:32:12
VincentVega
(c2mop:slot-definition-writers (first (c2mop:class-direct-slots (find-class class-name))))
12:32:22
VincentVega
(c2mop:slot-definition-writers (first (c2mop:class-slots (find-class class-name))))
12:33:10
jmercouris
and that way when you change something in a inherited class it updates in its descendants
12:33:56
jmercouris
my other guess is that this behavior is due to an implementation detail of CLOS within most implementations
12:35:39
VincentVega
but walking up the inheritence tree won't give me the effective list of writers/readers of the derived class unless I manually merge and that's a bother
12:36:44
VincentVega
I am generating :before methods for writers of those slots which invalidate cache of other slots
12:38:34
jmercouris
maybe you could make an instance of an object and inspect that more easily than the classes
12:39:26
VincentVega
i don't think it would even have to be runtime w/ eval-when :compile-toplevel, right?
13:31:18
jmercouris
mfiano: that is what I am doing, but it is not exactly the most cooperative interface...
19:40:45
VincentVega
Guys, why does ,@expr doesn't want to compile here? https://pastebin.com/gqBLSd7N
19:47:06
Bike
have you tried writing out what you want without using backquote? maybe that would make it more obvious.
19:47:28
Bike
i think the problem is that commas refer to the most recent backquote, and `,@expr obviously doesn't make sense on its own.
19:49:14
VincentVega
I am writing a macro-writing macro and that's what I figured the problem distills to.
19:49:21
pranavats
VincentVega: Comma-at must occur within a sequence. What it does is that it splices a list into a sequence. When you write `,@expr there is nowhere to splice the value of expr.
19:50:49
VincentVega
Bike: well I would expect `(f ,`,@expr) to simplify to `(f ,@expr), there's a comma before the backtick
19:51:52
aeth
VincentVega: if you have to nest multiple `s, don't do it directly imo. Either use a FLET or write a separate DEFUN that you call from inside of the DEFMACRO (if the latter, it needs to be in another file or in an EVAL-WHEN, though)