[flexi-streams-devel] Programmatic classes scrap boilerplate code

Edi Weitz edi at agharta.de
Tue Apr 24 08:50:05 UTC 2007


Hi Michael,

On Sat, 21 Apr 2007 12:20:50 +0200, Michael Weber <michaelw+flexi at foldr.org> wrote:

> I looked at flexi-streams' stream.lisp some time ago, and there
> seems to be a lot of boilerplate code to combine various mixins to
> specific stream classes.  Then, there seems to be code for parsing
> and combining what basically amounts to mixin designators, which are
> then again mapped on the specific stream classes.

Yes, unfortunately... :(

If you look at older versions[1], you'll see that FLEXI-STREAMS' code
was quite clear and elegant until 0.8.0, at least compared to the mess
it is now.  But, alas, it was simply too slow for several things and
the changes in 0.9.0 and afterwards have made it significantly faster
in many important areas (although of course it still can't compare to
direct stream access).

> The underlying issue is not new.  AMOP describes a nice way around
> it which creates classes composed from several mixins
> programmatically.  About a year or so ago, Christophe Rhodes fixed
> SBCL so that it accepts generalized class names.  The support code
> is little, you can find it here (usage example at the end of this
> mail):
> http://www.foldr.org/~michaelw/lisp/amop-programmatic-class.lisp
>
> I can't tell how well this is supported in Lispworks and other
> implementations, but it might be worth opening trouble tickets if
> it's not. :)
>
> OTOH, I understand the cost that comes with maintaining
> special-cased code for non-supporting implementations.  It might not
> be worth it.
>
> Still, I felt like sharing this, before I forget again. :)

Thanks for the info.  That's interesting, but certainly not something
I'll lose sleep about in the near future.  Adding something like this
before at least all major implementations support it, looks like a
nightmare to me.  I think I'm too lazy and pragmatic for that... :)

Cheers,
Edi.


[1] http://arcanes.fr.eu.org/~pierre/2007/02/weitz/



More information about the Flexi-streams-devel mailing list