|
Boost Users : |
From: Joel de Guzman (joel_at_[hidden])
Date: 2008-07-20 10:32:59
Zeljko Vrba wrote:
> On Sun, Jul 20, 2008 at 07:39:02PM +0800, Joel de Guzman wrote:
>> Can't see the connection yet? Don't limit yourself to just thinking in
>> terms of tuples. Think in terms of data-structures, sequences, containers,
>> views.
>>
> OK, let's take an example of a CSV parser. Let's say I read the whole CSV
> file into an std::vector<F>, where F is some fusion container. So far, so
> good. Now I want a view (abstraction) V that will let me treat i'th column
> of the dataset as if it were a vector, e.g. V[17] would return me the i'th
> column of 17th row, and even allow me to modify it. And then this abstraction
> could be passed around, iterated over, used in STL algorithms, etc. It has
> the same properties as vector (random access container), except that it's
> storage is not contiguous.
>
> Does this look like something that fusion could help with? (Though, for the
> record, I would personally not do casual data processing and CSV parsing in
> C++; the time spent learning fusion and coding processing functions seems much
> more productively spent in learning something like R.)
In that case, it's pointless to answer, or even try to comprehend your
question before this paragraph. So, I won't bother. For the record,
I would personally spend my time on something more productive.
> And no, I don't see the connection. For me, the emperor is naked (see below
> about maintainability). Maybe I'm stupid, maybe I'm just not easily
> susceptible to latest.. erm. "technologies", until they have proven their value
> (again, see below on maintainability to get an idea of my value metrics). Pick
> what you like.
>
>> Wrong analogy. ML has homogeneous lists, like STL. A list (in ML) is
>> essentially a sequence of items but they must be all of the same type.
>>
> Except that the "same type" can actually be a variant.
Sure. Like std::vector<boost::variant<int, char double> >. Sorry,
again, it's not the same.
>>> just "do
>>> not seem" useful at compile-time.. at least not when I'm thinking ML where
>> Are you saying that MPL is not useful too? Out of curiosity,
>> have you used MPL?
>>
> Stop reinterpreting my words to your convenience. I ignored one such previous
> case along those lines, but no more. I'm saying exactly what I wrote and what
> is quoted above: it does not seem useful. This is not the same as saying that
> it is not useful (which, for the record, although it should be obvious, I did
> NOT say).
Ok, pardon me. That's what I really wanted to ask, but I missed a word.
Yeah, it's not the same thing.
> No, I have not used MPL. Yes, I've read the introduction and motivation (the
> example with dimensional algebra), and it seems like a rather niche
> application. Heck, I've even tried to read the MPL book and the question mark
> in my head just got bigger, not smaller. It is a reference book about
> manipulating typelists, but it does not say what typelists are good for. I
> haven't been able to find a use for MPL myself. From my POV, it's a black
> magic used by library writers to provide "nice" library interfaces, and which
> spits out hundreds (or megabytes if the user is unlucky) of error messages if
> the user does something wrong.
Seems Dave gave a better answer than the one I was about to type.
Well, if MPL and the TMP book does not connect with you, no amount
of Fusion documentation will ever convince you of its merits. On one
hand, I want to answer your questions and queries, improve the docs,
write examples, etc. On the other hand, I'm starting to feel that
no amount of effort will ever make you change your mind, since,
it seems, it's already been made. If that's the case, and correct
me if I'm wrong, I'd rather spend my time on something more productive.
At the very least, however, I *do* agree with you that the docs need
improvement in the area you just took mention of: motivation.
I do intend to work on it.
Regards,
-- Joel de Guzman http://www.boostpro.com http://spirit.sf.net
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net