Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Lisp > complex inherit...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 7 Topic 12447 of 13148
Post > Topic >>

complex inheritance scheme using mixins

by Albert Krewinkel <krewinkel@[EMAIL PROTECTED] > May 8, 2008 at 09:05 PM

Hi,

during the last few days, I repeatedly encountered situations in which a
lot of functionality is provided using CLOS mixins.  A well know example
of this is Sonja Keenes CLOS implementation of streams:
input/output/bidirectional streams for disk/tape and element-type
8-bit-byte/32-bit-word/character.  To allow for all possible
combinations of direction, device-type and element-type, there is a
total of 15 instantiable cl***** (no bidirectional streams for tapes).

In the process of defining these 15 cl*****, 27 more have to be defined,
such that the 15 can be build by inheriting from those.  Most of the
total 42 cl***** don't even define any additional slots.  Writing them
results in a lot of boilerplate.

This observation made me think of possible simplifications in this
process: I feel like there's missing some method to generate "cross
products" of inheritance trees/graphs.  Let me explain using the example
of disk streams:

Streams have a basic class layout of the following form:

            stream
           /     \
input-stream     output-stream
           \     /
      bidirectional-stream


Now instead of having to write all disk-streams following the above
scheme by hand, I'd like to be able to do

 (define-cross-product-cl***** stream-class-graph disk)

and thereby get all the above stream cl***** s/stream/disk-stream/g
Finally, all that's left to do is
 (define-cross-product stream-cl***** device-cl***** element-types)
and - magic - all necessary cl***** are generated.  Only those with
additional slots would have to be defined by hand.

Now this doesn't seem easy, but I'm currently facing an application
where this would be more than usefull.  It would also make such schemes
more easily extensible, since one doesn't have to remember which
intermediate cl***** one has to write: Just define another device-type
and apply the crossproduct -- done.

Has that ever been done before?  Are there any research papers I should
look at?  This is more complex than I thought, so any help is highly
appreciated.

Thanks in advance
Albert
 




 7 Posts in Topic:
complex inheritance scheme using mixins
Albert Krewinkel <krew  2008-05-08 21:05:07 
Re: complex inheritance scheme using mixins
Ken Tilton <kennytilto  2008-05-08 16:35:47 
Re: complex inheritance scheme using mixins
"joswig@[EMAIL PROTE  2008-05-08 14:09:21 
Re: complex inheritance scheme using mixins
Albert Krewinkel <krew  2008-05-08 23:33:25 
Re: complex inheritance scheme using mixins
Ken Tilton <kennytilto  2008-05-08 18:41:35 
Re: complex inheritance scheme using mixins
Madhu <enometh@[EMAIL   2008-05-09 07:29:45 
Re: complex inheritance scheme using mixins
Albert Krewinkel <krew  2008-05-12 18:06:50 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Jul 25 17:55:13 CDT 2008.