freenode/#lisp - IRC Chatlog
Search
12:12:12
atlan
13:11 *** NAMES @fe[nl]ix __main__ _death _krator44 _Trasformatore_ _whitelogger ``Erik aaronjensen abbe add^__ adulteratedjedi AeroNotix aeth aijony akash47 akr alandipert alexmlw alms_clozure alphor amer angavrilov angular_mike antismap AntiSpamMeta antoszka aoh arbv Arcaelyx argoneus Aritheanie arrsim ArthurAGleckler[ asedeno askatasuna astronavt[m] atlan azrazalea banjiewen beach beaky benny billstclair bitch Bl
12:45:38
jackdaniel
looks like accidential paste. no need to call people (even hypothetically) dicks without a good reason
12:50:41
Younder
perhaps we should just live with it. This society has become somewhat excessively polite. Next we will all be hypocritical liars.
13:35:26
Shinmera
(defun class-subclasses (c) (let (r) (labels ((r (c) (unless (find c r) (push c r) (mapc #'r (c2mop:class-direct-subclasses c))))) (r c))))
13:51:27
Shinmera
beach: I specifically don't use pushnew because the unless also prevents re-traversing the subclasses if the class was already traversed.
15:38:25
phoe
Can I put any kind of hook that will execute whenever a class is being defined via DEFCLASS?
15:39:33
Xach
phoe: I haven't done that much, but my first instinct is via a metaclass and the standard initialize-instance stuff on it.
15:51:59
phoe
My problem is, I'm defining some protocol classes that are not meant to be instantiated. This class can be subclassed, both by other protocol classes and by concrete classes.
15:53:05
phoe
I want a programmatic way to get all concrete subclasses of a given protocol class. So, for example, if there's a protocol class A, a concrete class B that subclasses A, a protocol class C that subclasses A, and a concrete class D that subclasses C, (class-concrete-classes 'a) should return (B D).
15:54:57
phoe
I have power over how I define protocol classes, so I can just enumerate them in some sort of list or hash table or whatever. But I have no power over redefining classes, so if the user defines class A as a concrete class, then my records are no longer valid.
15:55:12
pjb
Alternatively, protocol classes or concrete classes, or both, could inherit from a protocol or concrete abstract superclass.
15:55:53
phoe
pjb: this won't work, because each concrete class would be a subclass of a protocol class which would be a subclass of that specific superclass for protocols.
15:56:51
pjb
If you have control over defining protocol classes, then you can use a specific macro that will record them as such.
15:56:54
phoe
Like, I have a protocol class LOGGER, a concrete class STANDARD-LOGGER subclassing LOGGER, a protocol class FANCY-LOGGER subclassing LOGGER, a concrete class STANDARD-FANCY-LOGGER subclassing FANCY-LOGGER.
15:58:58
phoe
So I wish I had some standard means of introducing global hooks whenever a class is (re)defined.
15:59:07
Shinmera
Provide a facility to define your protocol classes that maintains the state, rather than letting them use just defclass.
16:00:14
Shinmera
Generally if you tell your users how to do something, they won't go against you unless they already have good reason to, or are somehow oblivious. In the latter case you did not document well enough
16:00:37
Shinmera
And in the former case there's no reason to struggle anyway because they will do what they want no matter.
16:02:28
pjb
phoe: then I would say, you should think about what makes a protocol class vs. a concrete class, if the user can redefine them.
16:03:14
pjb
phoe: also when it's done. Granted, one can define or redefine classes at run-time, but defclass is a macro, so clearly, creating classes at run-time is rather a rare occurence (changing classes may be more frequent).
16:03:43
pjb
phoe: so perhaps you want a pair of run-time functions: register-protocol-class unregister-protocol-class
17:52:22
atlan
Hi, I'm having trouble with quickload trying to find something from sbcl 1.4.1 when I've got 1.4.2 locally. Could I tell it to look in a different dir? I'm running brewed sbcl on macos sierra
19:21:09
didi
phoe: I see. There is https://github.com/tokenrove/series with some commits after 2010.
19:34:55
phoe
didi: you could contact the author of this fork and perhaps open a quicklisp-projects issue for changing the mirror.
20:28:28
phoe
didi: then just open it and let it stay open. Perhaps someone else will be able to pick it up.