On Tuesday, 30 August 2016 at 14:58:16 UTC, Chris Wright wrote:
We can only track types, not values, and that strongly hampers
our ability to reduce ranges.
Playing with some examples, I think the real issue is that
precise bounds tracking requires analyzing the formula as a
whole, rather
On Tuesday, 30 August 2016 at 14:58:16 UTC, Chris Wright wrote:
On Tue, 30 Aug 2016 13:24:04 +, tsbockman wrote:
Ranges don't always grow. Some operations will also cause them
to shrink, if they're really being tracked correctly:
We can only track types, not values, and that strongly
On Tue, 30 Aug 2016 13:24:04 +, tsbockman wrote:
> On Tuesday, 30 August 2016 at 03:37:06 UTC, Chris Wright wrote:
>> On Mon, 29 Aug 2016 18:20:05 +, tsbockman wrote:
>>> They should. Generally speaking, if that doesn't produce reasonable
>>> bounds (leaving aside rounding errors) at the
On 08/29/2016 11:37 PM, Chris Wright wrote:
On Mon, 29 Aug 2016 18:20:05 +, tsbockman wrote:
On Tuesday, 23 August 2016 at 20:40:06 UTC, Andrei Alexandrescu wrote:
When composing, do the limits compose meaningfully?
They should. Generally speaking, if that doesn't produce reasonable
On Tuesday, 30 August 2016 at 03:37:06 UTC, Chris Wright wrote:
On Mon, 29 Aug 2016 18:20:05 +, tsbockman wrote:
They should. Generally speaking, if that doesn't produce
reasonable bounds (leaving aside rounding errors) at the end
of the computation, it means that the logic of the
On Mon, 29 Aug 2016 18:20:05 +, tsbockman wrote:
> On Tuesday, 23 August 2016 at 20:40:06 UTC, Andrei Alexandrescu wrote:
>> When composing, do the limits compose meaningfully?
>
> They should. Generally speaking, if that doesn't produce reasonable
> bounds (leaving aside rounding errors) at
On Tuesday, 23 August 2016 at 20:40:06 UTC, Andrei Alexandrescu
wrote:
When composing, do the limits compose meaningfully?
They should. Generally speaking, if that doesn't produce
reasonable bounds (leaving aside rounding errors) at the end of
the computation, it means that the logic of the
On 08/29/2016 11:33 AM, Marco Leise wrote:
The following could make it
more accessible, much like the two Exception constructors we
have:
alias CheckedInt(T, T min, T max, Hook = Abort) =
CheckedIntImpl!(T, Hook, min, max);
alias CheckedInt(T, Hook = Abort) =
CheckedIntImpl!(T,
Am Tue, 23 Aug 2016 16:40:06 -0400
schrieb Andrei Alexandrescu :
> Currently checkedint (https://github.com/dlang/phobos/pull/4613) stands
> at 2432 lines and implements a variety of checking behaviors. At this
> point I just figured I can very easily add custom
Update: I've taken a shot at adding bounds, see
https://github.com/dlang/phobos/pull/4613/commits/bbdcea723e3dd98a979ae3f06a6786645647a778.
Here are a few notes:
* The Hook API works nicely with built-in or custom hooks, so no change
there was necessary.
* The constructor got quite a bit
On Tuesday, 23 August 2016 at 20:40:06 UTC, Andrei Alexandrescu
wrote:
Currently checkedint
(https://github.com/dlang/phobos/pull/4613) stands at 2432
lines and implements a variety of checking behaviors. At this
point I just figured I can very easily add custom bounds, e.g.
an int limited to
what about two types.
alias BI = Bound!int;
alias CBI = CheckedInt!BI;
if Bound behaves as an integer people can choose.
On 08/24/2016 05:05 AM, Lodovico Giaretta wrote:
On Wednesday, 24 August 2016 at 00:40:15 UTC, Andrei Alexandrescu wrote:
That wouldn't work for e.g. NaN. A NaN wants to "steal" a value but
only if that's not available. It's complicated.
Ok, I get your point. WithNaN should not waste the
On Wednesday, 24 August 2016 at 00:40:15 UTC, Andrei Alexandrescu
wrote:
That wouldn't work for e.g. NaN. A NaN wants to "steal" a value
but only if that's not available. It's complicated.
Ok, I get your point. WithNaN should not waste the "official
range" when there is a huge wasted
On Wednesday, 24 August 2016 at 08:39:28 UTC, Nordlöw wrote:
Such an implementation is `IndexedBy` at
https://github.com/nordlow/phobos-next/blob/master/src/typecons_ex.d#L167
Correction: Index type here is actually a Ada-style modulo type
which does wrap-around instead of truncation.
On Tuesday, 23 August 2016 at 20:40:06 UTC, Andrei Alexandrescu
wrote:
Currently checkedint
(https://github.com/dlang/phobos/pull/4613) stands at 2432
lines and implements a variety of checking behaviors. At this
point I just figured I can very easily add custom bounds, e.g.
an int limited to
On 08/23/2016 05:08 PM, Lodovico Giaretta wrote:
On Tuesday, 23 August 2016 at 20:40:06 UTC, Andrei Alexandrescu wrote:
* When assigning a Checked to another, should the limits be matched
statically or checked dynamically?
The ideal would be implicit cast allowed when widening, explicit
On Tuesday, 23 August 2016 at 20:40:06 UTC, Andrei Alexandrescu
wrote:
* When composing, do the limits compose meaningfully?
Just to make sure I understand what you mean by "composing
limits", do you mean this?
alias NonNegativeInt = CheckedInt!(int, Abort, 0, int.max);
alias Ubyte =
On Tuesday, 23 August 2016 at 20:40:06 UTC, Andrei Alexandrescu
wrote:
* When assigning a Checked to another, should the limits be
matched statically or checked dynamically?
The ideal would be implicit cast allowed when widening, explicit
required when narrowing. As I think we will have to
On Tuesday, 23 August 2016 at 20:40:06 UTC, Andrei Alexandrescu
wrote:
I think all of these questions have answers, but I wanted to
gauge the interest in bounded checked integrals. Would the need
for them justify additional complications in the definition?
Well, this occurs very frequently in
Currently checkedint (https://github.com/dlang/phobos/pull/4613) stands
at 2432 lines and implements a variety of checking behaviors. At this
point I just figured I can very easily add custom bounds, e.g. an int
limited to 0 through 100 etc. It would take just a few lines because a
lot of
21 matches
Mail list logo