Boost.units ported to D

Arlen arlen.ng at gmx.com
Mon Feb 11 09:24:01 PST 2013


Greetings,

source: https://github.com/Arlen/phobos/blob/std_units/std/units.d
docs: http://arlen.github.com/phobos/std_units.html

you will also need the rational module,

source: https://github.com/Arlen/phobos/blob/std_rational/std/rational.d
docs: http://arlen.github.com/phobos/std_rational.html

There is still some work to be done, so I'm calling it an alpha release.  I
don't know if it belongs in Phobos or not, but I hope others will find it
useful as I have.

External Issues:
1. Many of the definitions of the systems have been commented out (starting
line 3217) because during compilation DMD runs out of memory.  As it is, on
my system DMD consume nearly 2GB of ram.  As a side note, the definitions
should be in their own separate modules, but for now they are placed in
structs.

2. Very long and not so helpful error messages.  When I say long I'm
talking hundreds and sometimes thousands of lines of error messages
produced by DMD.

Bugs in D:
If you grep for "D_BUG_" you will find several potential bugs that I've
marked.  I would appreciate it if someone could take a look.

FIXMEs:
There are a number of FIXMEs, and at the moment I don't have the best
solution for them.  You will find them if you grep for "FIXME_", with
FIXME_6 being the most important one.

And then there are the potential bugs in Boost.units, which you will find
in the very last part of the units.d module.  I have posted several of them
on stackoverflow.  I have also emailed the original authors and waiting to
hear from them.  #4 is holding back the completion of Absolute, which also
affect Quantity.  I'm considering removing Absolute altogether.

And finally, there is the function convert (line 3666).  It needs some
cleanup, but this is the function used to explicitly convert from a
quantity to another.  I haven't decided on the actual syntax yet, but in
Boost.units casting is used (e.g., quantity<cgs::length> L1 =
static_cast<quantity<cgs::length> >(L2)).  Any ideas?

Arlen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20130211/8f153612/attachment.html>


More information about the Digitalmars-d mailing list