On Thursday, 28 June 2018 at 19:22:38 UTC, Jonathan M Davis wrote:
On Thursday, June 28, 2018 18:10:07 kdevel via
Digitalmars-d-learn wrote:
On Tuesday, 26 June 2018 at 21:54:49 UTC, Jonathan M Davis
wrote:
> [H]onestly, I don't understand why folks keep trying to put
> nullable types in Nullab
On Thursday, June 28, 2018 19:45:52 kdevel via Digitalmars-d-learn wrote:
> On Thursday, 28 June 2018 at 19:22:38 UTC, Jonathan M Davis wrote:
> > Nullable makes sense in generic code, because the code isn't
> > written specifically for them, but something like
> > Nullable!MyClass in non-generic c
On Thursday, 28 June 2018 at 18:10:07 UTC, kdevel wrote:
On Tuesday, 26 June 2018 at 21:54:49 UTC, Jonathan M Davis
wrote:
[H]onestly, I don't understand why folks keep trying to put
nullable types in Nullable in non-generic code.
How do you signify that a struct member of class type is
optio
On Thursday, 28 June 2018 at 19:22:38 UTC, Jonathan M Davis wrote:
Nullable makes sense in generic code, because the code isn't
written specifically for them, but something like
Nullable!MyClass in non-generic code is pointless IMHO, because
a class reference is already nullable.
It is alread
On Thursday, June 28, 2018 18:10:07 kdevel via Digitalmars-d-learn wrote:
> On Tuesday, 26 June 2018 at 21:54:49 UTC, Jonathan M Davis wrote:
> > [H]onestly, I don't understand why folks keep trying to put
> > nullable types in Nullable in non-generic code.
>
> How do you signify that a struct memb
On Tuesday, 26 June 2018 at 21:54:49 UTC, Jonathan M Davis wrote:
[H]onestly, I don't understand why folks keep trying to put
nullable types in Nullable in non-generic code.
How do you signify that a struct member of class type is optional?
On Tuesday, June 26, 2018 19:03:20 kdevel via Digitalmars-d-learn wrote:
> On Monday, 25 June 2018 at 22:58:41 UTC, Jonathan M Davis wrote:
> > On Monday, June 25, 2018 19:40:30 kdevel via
> >
> > Digitalmars-d-learn wrote:
> >> R r;
> >>
> >> if (r.s is null)
> >>
> >>throw new Exc
On Tuesday, 26 June 2018 at 14:32:59 UTC, Nathan S. wrote:
On Monday, 25 June 2018 at 19:40:30 UTC, kdevel wrote:
Is it possible
to "lower" the Nullable operations if T is a class type such
that there
is only one level of nullification?
Yes: https://run.dlang.io/is/hPxbyf
template Null
On Monday, 25 June 2018 at 22:58:41 UTC, Jonathan M Davis wrote:
On Monday, June 25, 2018 19:40:30 kdevel via
Digitalmars-d-learn wrote:
R r;
if (r.s is null)
throw new Exception ("some error message");
[...]
Why can't this programming error be detected at compile time?
If
On Monday, 25 June 2018 at 22:58:41 UTC, Jonathan M Davis wrote:
Java does try to force you to initialize stuff (resulting in
annoying false positives at times), but in general, it still
can't guarantee when a variable is null or not and is forced to
insert runtime null checks.
Java can be so
On Monday, 25 June 2018 at 19:40:30 UTC, kdevel wrote:
Is it possible
to "lower" the Nullable operations if T is a class type such
that there
is only one level of nullification?
Yes: https://run.dlang.io/is/hPxbyf
template Nullable(S)
{
import std.traits : isPointer, isDynamicArray;
On Monday, June 25, 2018 19:40:30 kdevel via Digitalmars-d-learn wrote:
> Just stumbled over the following design:
>
> class S {...}
>
> class R {
>
>Nullable!S s;
>
> }
>
> s was checked in code like
>
> R r;
>
> if (r.s is null)
>throw new Exception ("some erro
Just stumbled over the following design:
class S {...}
class R {
:
Nullable!S s;
:
}
s was checked in code like
R r;
:
if (r.s is null)
throw new Exception ("some error message");
At runtime the following was caught:
fatal error: caught Throwable
13 matches
Mail list logo