Boost logo

Boost :

From: Janek Kozicki (janek_listy_at_[hidden])
Date: 2006-06-14 16:00:22


Andy Little said: (by the date of Wed, 14 Jun 2006 20:22:35 +0100)
> "Janek Kozicki" wrote
> > Andy Little said: (by the date of Tue, 13 Jun 2006 00:59:11 +0100)
> >
> > > t1_quantity type in PQS is overcomplicated. Two decisions complicated the design
> > > of t1_quantity. The first was the requirement to distinguish dimensionally
> > > equivalent quantities (torque and energy say).
> >
> > IMHO this distinguish is not that important. We only need units so that
> > compiler will check if there is any mistake in the formulas...
>
> I think the ability to distinguish quantity types is important for other
> purposes.

I'm sorry about being a bit picky. You said it's overcomplicated
(11 lines above this line). Now you say it's needed (4 lines above ;)

Can you give examples of where ability to distiguish is useful? With
exception of serialization examples because it is listed below (printing
unit correctly).

> > Difference between torque and energy happens only during serialization
> > (print N*m, or print J ?), so maybe instead of complicated
> > abstract_quantity_id, there should be just some extra argument/setting
> > that will talk with serialization functions?
>
> Having thought about that I come to the conclusion that it is worthwhile to have
> the extra complexity in the t1_quantity/fixed_quantity. Having some form of
> output/serialisation for quantities is seemingly trivial, something like a toy
> feature, but it is very useful indeed for demonstrating and communicating what
> the type can do and for diagnosing what it is doing with minimal effort. That
> may seem trivial but that type of feedback is very helpfull in the first stage
> of trying out a library to see what it can do. I can speculate that is part of
> the reason for the good level of interest in PQS, because it helps when
> providing short examples in discussions like this. That simple functionality is
> underrated IMO.

I have difficulties understanding this paragraph. You say that PQS
should be able to print "N*m" or print "J" depending on the context,
because it is a very helpfull feedback. Right?

-- 
Janek Kozicki                                                         |

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk