On 1 Dec 2010, at 18:16, Faré wrote:
On 1 December 2010 10:25, Daniel Weinreb dlw@itasoftware.com 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 and a write-string operation. The common base class provides an implementation of write-string that works by iterating over the characters of the string and calling write-character. Any output stream that can write strings in a more efficient way can override that method.
In my "pure" datastructure library (currently part of fare-utils, to be spun off as lil - lisp interface library), I use mixins to provide these "methods". So instead of adding the method to a base class, I would provide a mixin "write-string-from-write-char", and then could possibly add an opposite mixin "write-char-from-write-string", without creating a paradox that will byte you.
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?
Pascal