freenode/#lisp - IRC Chatlog
Search
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.
21:39:09
whoman
ah. i was hoping for a record update, reverse destructuring-bind i suppose; or if it is not too hard to make a slot-values place
21:42:42
Bike
reinitialize instance more or less lets you set a bunch of slots at once. is that not what you said?
21:43:32
whoman
yes, exactly .. but, i assumed the title was something that shouldnt happen as often as i would like it to (all the time)
21:54:48
Xach
borodust: hi, when i try to dist-update it does not think there is anything new. version issue maybe?
22:23:54
earl-ducaine
Lispologists! q: getting an SBCL warning that I'm using an obsolete form of do when I try and compile the following: (defun my-do-old () (do ((alfa 0.0)) () (return (list alfa))))
22:24:17
earl-ducaine
I'm guessing that that's the old way of writing: (defun my-do-ansi () (do ((alfa 0.0)) (nil) (return (list alfa))))
22:25:16
earl-ducaine
i.e. exit condition for 'do forever' used to be just the empty list now the exit clause must have the condition to be checked, even if it's constant.
22:31:45
phoe
earl-ducaine: I think so, yes. I think the return condition must be explicitly stated, even if it's always NIL.
22:32:28
phoe
;; Though that function could be obviously optimized to (defun my-do-old () (list 0.0)) - but I don't think that's what your question is about.
22:37:58
phoe
Bike: In this case, I have no idea. It could perhaps be possible to study CLtL1 and earlier Lisp manuals.
22:38:28
earl-ducaine
Thanks phoe just too lazy to qualify my example as being for illustritave purposes only! Bike: yes that's correct.
22:38:35
earl-ducaine
Just refered back to the Chinual and it seems even in Zeta Lisp (nil) was normative for 'do forever'
22:39:15
earl-ducaine
So, it must of been a syntax error that just happened to work in older implementations.