On Thursday, 6 September 2012 at 12:22:08 UTC, David Nadlinger
wrote:
Can you elaborate on that? I must admit that I didn't actively
work on std.units for quite some while now, as general interest
in it seemed to have faded (I'm glad to be proven wrong,
though), but adding quantities of the sam
On Wednesday, 5 September 2012 at 05:53:49 UTC, anonymous wrote:
I noticed two flaws in std.units:
1) Can't add quantities of the same type (this is probably
trivial to fix).
2) Different scopes don't make different quantity types.
Can you elaborate on that? I must admit that I didn't activel
Nicholas Londey:
however I am less convinced on systems that allow implicit
combining of units of the same quantity type. I feel part of
the type is its range and precision and so there is no valid
way to implicitly add kilometers to millimeters for example.
I see. If the range and precision
Thank you everyone for your replies.
Initially I think I am going to role my own as my requirements
are fairly simple compared to a full blown system with units of
measure. My goal is to have large number of application specific
types which may be implemented as the same but are semantically
On Wednesday, 5 September 2012 at 11:50:12 UTC, bearophile wrote:
Don Clugston:
I'd be interested to know if that idea is ever used in real
code. I mean, it's a classic trendy template toy, but does
anyone actually use it?
As usual I don't have usage statistics.
I like dynamic languages, li
Don Clugston:
I'd be interested to know if that idea is ever used in real
code. I mean, it's a classic trendy template toy, but does
anyone actually use it?
As usual I don't have usage statistics.
I like dynamic languages, like Python. But if you give me a
static type system, then I want so
On 05/09/12 03:42, bearophile wrote:
Nicholas Londey:
for example degrees west and kilograms such that they cannot be
accidentally mixed in an expression.
Using the static typing to avoid similar bugs is the smart thing to do :-)
I'd be interested to know if that idea is ever used in real c
On Wednesday, 5 September 2012 at 05:03:38 UTC, Simen Kjaeraas
wrote:
Not mine, but this is the implementation I use:
https://github.com/klickverbot/phobos/tree/units/std
Files are units.d and si.d.
Documentation:
http://klickverbot.at/code/units/std_units.html
http://klickverbot.at/code/uni
On Wed, 05 Sep 2012 02:55:45 +0200, Nicholas Londey
wrote:
Hello.
I am trying to work out if there is existing support for strongly typed
numerical values for example degrees west and kilograms such that they
cannot be accidentally mixed in an expression. I have vague recollection
of se
On 09/04/2012 08:11 PM, ixid wrote:
> Using this:
>
> struct Grams
> {
> size_t amount;
> }
>
> @property Grams grams(size_t amount)
> {
> return Grams(amount);
> }
>
> void main()
> {
> auto weight = 5.grams;
> weight = weight + 10.grams;
> }
>
> How would you use it? I thought the point of this
Using this:
struct Grams
{
size_t amount;
}
@property Grams grams(size_t amount)
{
return Grams(amount);
}
void main()
{
auto weight = 5.grams;
weight = weight + 10.grams;
}
How would you use it? I thought the point of this sort of strong
typing was to be able to carry out ari
On 09/04/2012 05:55 PM, Nicholas Londey wrote:
> I could easily implement my own as I have done in C++ in the
> past but assume there is a standard implementation which I would prefer.
> Any help or links to examples much appreciated.
UFCS enables some interesting syntax:
struct Grams
{
siz
On Wednesday, 5 September 2012 at 00:55:12 UTC, Nicholas Londey
wrote:
Hello.
I am trying to work out if there is existing support for
strongly typed numerical values for example degrees west and
kilograms such that they cannot be accidentally mixed in an
expression. I have vague recollection
Nicholas Londey:
for example degrees west and kilograms such that they cannot be
accidentally mixed in an expression.
Using the static typing to avoid similar bugs is the smart thing
to do :-)
I have vague recollection of seeing a presentation
by Walter talking about this but I cannot see
Hello.
I am trying to work out if there is existing support for strongly
typed numerical values for example degrees west and kilograms
such that they cannot be accidentally mixed in an expression. I
have vague recollection of seeing a presentation by Walter
talking about this but I cannot seem
15 matches
Mail list logo