Re: Why does nobody seem to think that `null` is a serious problem in D?

2018-12-01 Thread Sebastiaan Koppe via Digitalmars-d-learn
On Saturday, 1 December 2018 at 20:41:53 UTC, Sebastiaan Koppe wrote: Since the compiler can prove which branch is taken, the analyse has to assume both are. *can't*

Re: Why does nobody seem to think that `null` is a serious problem in D?

2018-12-01 Thread Sebastiaan Koppe via Digitalmars-d-learn
On Saturday, 1 December 2018 at 19:02:54 UTC, H. S. Teoh wrote: But that's precisely the problem. It's not always possible to tell whether a variable has been initialized. E.g.: int func(int x) { int *p; if (solveRiemannHypothesis()) {

Re: Why does nobody seem to think that `null` is a serious problem in D?

2018-12-01 Thread H. S. Teoh via Digitalmars-d-learn
On Sat, Dec 01, 2018 at 06:30:05PM +, Tony via Digitalmars-d-learn wrote: > On Saturday, 1 December 2018 at 11:16:49 UTC, Dukc wrote: > > This is great when it works, but the problem is that it would be > > gargantuan effort -and compile time sink- to make it work perfectly. > > When it's just

Re: Why does nobody seem to think that `null` is a serious problem in D?

2018-12-01 Thread Tony via Digitalmars-d-learn
On Saturday, 1 December 2018 at 11:16:49 UTC, Dukc wrote: This is great when it works, but the problem is that it would be gargantuan effort -and compile time sink- to make it work perfectly. When it's just about if-else if chains, switches or boolean logic as in the example, the analysis

Re: LDC2 win64 calling convention

2018-12-01 Thread Johan Engelen via Digitalmars-d-learn
On Thursday, 29 November 2018 at 15:10:41 UTC, realhet wrote: In conclusion: Maybe LDC2 generates a lot of extra code, but I always make longer asm routines, so it's not a problem for me at all while it helps me a lot. An extra note: I recommend you look into using `ldc.llvmasm.__asm` to

Re: Why does nobody seem to think that `null` is a serious problem in D?

2018-12-01 Thread Kagamin via Digitalmars-d-learn
On Friday, 30 November 2018 at 15:32:55 UTC, 12345swordy wrote: NotNullable!MyClassImpl = (MyClassImpvar != Null) ? MyClassImpvar : new MyClassImpvar(); AFAIK it's something like NotNullable!MyClassImp m = MyClassImpvar.orElse(new MyClassImp());

Re: Why does nobody seem to think that `null` is a serious problem in D?

2018-12-01 Thread Dukc via Digitalmars-d-learn
On Saturday, 1 December 2018 at 00:32:35 UTC, Tony wrote: isocpp.org just had a link to a blog post where someone makes a case for uninitialized variables in C++ being an advantage in that you can potentially get a warning regarding use of an uninitialized variable that points out an error in