|
Boost : |
From: Aleksey Gurtovoy (alexy_at_[hidden])
Date: 2001-12-18 06:54:31
Peter Dimov wrote:
> * MPL is dominated by an iterative idiom, AFAICS. Nearly
> everything is done with a for-style loop.
That's an implementation detail :). Speaking seriously, it was easier for me
to write the algorithms this way, and most of these implementations are
prototypes, and were _intended_ to be re-written when somebody (including
me) will have time/reasons/motivation for it. Considering how fast I was
able to implement them, I think that it was a good trade off at the time. I
also think that now it's time to get rid of the naive implementations
because they seems to cause too much concern :).
> This might have its benefits (more gentle learning curve for C++/STL
> programmers) but I think that the recursive style of programming
> sometimes produces more elegant and readable functions.
Sure! Don't fall into "pattern matching" trap, though :).
> * MPL tries to emulate the STL to the extent of using iterators into
> abstract sequences, and providing different 'containers' with their
> associated 'traits.' It even has a 'clear' function that
> returns a new empty 'container' of the same type.
>
> In contrast, Lisp builds everything out of pairs; its only
> data structure is the binary tree. A Lisp tree is nearly always a slist;
> nevertheless, sometimes a binary tree is a better fit for the concept
> being modeled.
>
> Both approaches have pros and cons. I prefer the traditional Lisp way.
> Without a motivating example to the contrary, I'm inclined to
> think that in this area MPL is over-generic.
Have you read http://groups.yahoo.com/group/boost/message/20770 message?
Aleksey
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk