Re: [pro] Modularity for subclassing in Common Lisp

2010-12-22 Thread Daniel Weinreb
Anton, These are all very good questions. I'm going to try to write up an essay about these topics suitable for posting on my blog, since there's so much to say. The use of packages that I have been advocating here is not used a lot in practice in Common Lisp, but the more I think about it, the

Re: [pro] Modularity for subclassing in Common Lisp

2010-12-18 Thread Anton Vodonosov
Daniel, I think I understand the issue better now. Not that your idea - how base class provides implementation for reuseby subclasses and using packages to specify this protocol - was impossibleto understand from your first mail. I see that my doubts and the form of my previous email are caused by

Re: [pro] Modularity for subclassing in Common Lisp

2010-12-08 Thread Daniel Weinreb
Anton, Thank you very much for your mail. It prompted me to explain what I'm thinking of in a much more clear (I hope!!) way. Here we go: Anton Vodonosov wrote: What is the difference for modularity in case of subclassing, from other cases were we apply modularity? I can't find the differen

Re: [pro] Modularity for subclassing in Common Lisp

2010-12-08 Thread Daniel Weinreb
Anton, Thank you very much for your mail. It prompted me to explain what I'm thinking of in a much more clear (I hope!!) way. Here we go: Anton Vodonosov wrote: > What is the difference > for modularity in case of subclassing, from other cases were we apply modularity? > I can't find the d

Re: [pro] Modularity for subclassing in Common Lisp

2010-12-08 Thread Scott McKay
On Dec 7, 2010, at 11:10 PM, Matthew D. Swank wrote: > On 12/07/2010 09:19 PM, Faré wrote: >> A better question might be >> how do you enforce disjointness of some mixins. I suppose a >> heavy-handed use of MOP magic could do it, but oh well. > Q: Doctor, it hurts when I do this. > A: Well, don't

Re: [pro] Modularity for subclassing in Common Lisp

2010-12-07 Thread Matthew D. Swank
On 12/07/2010 09:19 PM, Faré wrote: > A better question might be > how do you enforce disjointness of some mixins. I suppose a > heavy-handed use of MOP magic could do it, but oh well. Q: Doctor, it hurts when I do this. A: Well, don't do that. In the examples I looked at that inspired me to use I

Re: [pro] Modularity for subclassing in Common Lisp

2010-12-07 Thread Faré
On 7 December 2010 14:00, Pascal Costanza wrote: > On 1 Dec 2010, at 18:16, Faré wrote: > The term 'mixins' sets of my alarm bells. ;) But first a question, to better > understand what you mean here: How do you reconcile the notion of mixins with > multiple dispatch? > I don't know that there's

Re: [pro] Modularity for subclassing in Common Lisp

2010-12-07 Thread Pascal Costanza
On 1 Dec 2010, at 18:16, Faré wrote: > On 1 December 2010 10:25, Daniel Weinreb wrote: >> First, a common base class can provide implementations of some of the >> generic functions all by itself. My favorite simple example is an >> "output stream" protocol, that has a write-character operation

Re: [pro] Modularity for subclassing in Common Lisp

2010-12-07 Thread Pascal Costanza
On 1 Dec 2010, at 21:16, Daniel Weinreb wrote: > I have always liked the idea of having protocols > say more than just "these are the functions > and these are the arguments, which are optional, > ane maybe what their types are. I'd love it > if there were a way to say "in order to fulfill > thi

Re: [pro] Modularity for subclassing in Common Lisp

2010-12-07 Thread Pascal Costanza
On 1 Dec 2010, at 16:25, Daniel Weinreb wrote: > I call the set of defgenerics (plus the factory functions) the > "protocol". The word "type" is sort of right but carries a lot of > connotations and freight that I'd rather avoid. In the Haskell community, these beasts are called 'type classes'.

Re: [pro] Modularity for subclassing in Common Lisp

2010-12-07 Thread Michael Forster
On Wed, Dec 1, 2010 at 8:29 PM, Daniel Herring wrote: > On Wed, 1 Dec 2010, Daniel Weinreb wrote: > >> Smalltalk didn't even try.  CLOS, I believe, does not try and there is >> not an idiomatic way to do it.  The only language I know that makes a >> good stab in this direction is C++, which has "p

Re: [pro] Modularity for subclassing in Common Lisp

2010-12-06 Thread Anton Vodonosov
I think the idea to use packages to specify module protocol (interface, contract) is right. And also I think this is better than to have a separate public/protected/private language feature for classes. What would be the motivation for a separate language feature? What is the difference for

Re: [pro] Modularity for subclassing in Common Lisp

2010-12-04 Thread Matthew D. Swank
On 12/01/2010 03:11 PM, Faré wrote: >> I have always liked the idea of having protocols >> say more than just "these are the functions >> and these are the arguments, which are optional, >> ane maybe what their types are. >> > You can have that in Lisp to a point with Interface-Passing Style: >

Re: [pro] Modularity for subclassing in Common Lisp

2010-12-01 Thread Daniel Herring
On Wed, 1 Dec 2010, Daniel Weinreb wrote: > Smalltalk didn't even try. CLOS, I believe, does not try and there is > not an idiomatic way to do it. The only language I know that makes a > good stab in this direction is C++, which has "public", "protected", > and "private". Whatever else you say

Re: [pro] Modularity for subclassing in Common Lisp

2010-12-01 Thread Faré
> I have always liked the idea of having protocols > say more than just "these are the functions > and these are the arguments, which are optional, > ane maybe what their types are. > You can have that in Lisp to a point with Interface-Passing Style: http://fare.livejournal.com/155094.html

Re: [pro] Modularity for subclassing in Common Lisp

2010-12-01 Thread Daniel Weinreb
Faré wrote: On 1 December 2010 10:25, Daniel Weinreb wrote: Here is a way that CL sucks badly: protocols are not first-class entities. To modify a protocol is something done to the source code *outside* of the Lisp world. It cannot be done programmatically. Adherence to the protocol cannot

Re: [pro] Modularity for subclassing in Common Lisp

2010-12-01 Thread Faré
On 1 December 2010 10:25, Daniel Weinreb wrote: > I call the set of defgenerics (plus the factory functions) the > "protocol".  The word "type" is sort of right but carries a lot of > connotations and freight that I'd rather avoid. > Here is a way that CL sucks badly: protocols are not first-class

[pro] Modularity for subclassing in Common Lisp

2010-12-01 Thread Daniel Weinreb
(This is a new topic.) Many times, people have presented a major problem with object-oriented programming as it is often/idiomatically used. The good thing is that OOP, when done right (in Lisp, that means, among other things, always using defgeneric explicitly), provides a great abstarct interfa