View mode: basic / threaded / horizontal-split · Log in · Help
June 22, 2012
Re: Stack overflow
Am 22.06.2012 23:11, schrieb Namespace:
>> debugger), but my guess is that Namespace just doesn't know how to do
>> that or
>> that it's even possible - hence his frustration with not getting any
>> information.
>
> Exactly.
>
> And I use VisualD and the standard debugger of it.
>

Sorry but I would learn how to use the debugger instead (it helps a 
lot!), instead of implementing features which emulate C++ behaviour 
(according to your blog) and will confuse people, e.g. if you 
documentate that, people will be like *huh this cannot be null, is this 
a feature I don't know?* and end up confused.
June 23, 2012
Re: Stack overflow
On Friday, 22 June 2012 at 23:01:47 UTC, David wrote:
> Am 22.06.2012 23:11, schrieb Namespace:
>>> debugger), but my guess is that Namespace just doesn't know 
>>> how to do
>>> that or
>>> that it's even possible - hence his frustration with not 
>>> getting any
>>> information.
>>
>> Exactly.
>>
>> And I use VisualD and the standard debugger of it.
>>
>
> Sorry but I would learn how to use the debugger instead (it 
> helps a lot!), instead of implementing features which emulate 
> C++ behaviour (according to your blog) and will confuse people, 
> e.g. if you documentate that, people will be like *huh this 
> cannot be null, is this a feature I don't know?* and end up 
> confused.

I would prefer NullPointer Exceptions and / or not null types 
rather than playing around with the debugger.
That's the first step.
June 23, 2012
Re: Stack overflow
Am 23.06.2012 07:27, schrieb Namespace:
> I would prefer NullPointer Exceptions and / or not null types rather
> than playing around with the debugger.
> That's the first step.

Yeah but not implemented by a library.
June 23, 2012
Re: Stack overflow
On Saturday, 23 June 2012 at 09:53:35 UTC, David wrote:
> Am 23.06.2012 07:27, schrieb Namespace:
>> I would prefer NullPointer Exceptions and / or not null types 
>> rather
>> than playing around with the debugger.
>> That's the first step.
>
> Yeah but not implemented by a library.

Not yet. ;)
June 23, 2012
Re: Stack overflow
So here i proudly present my Ref struct (2.0 ;))
http://dpaste.dzfl.pl/905e1d3d

So, any suggestions, further ideas or criticism?
June 23, 2012
Re: Stack overflow
BTW: Any tries to declare
@disable
this(typeof(null)); end with the same message "Stack overflow"...
June 23, 2012
Re: Stack overflow
On Saturday, June 23, 2012 07:27:56 Namespace wrote:
> I would prefer NullPointer Exceptions and / or not null types
> rather than playing around with the debugger.
> That's the first step.

NullPointerExceptions (well, they'd end up being NullPointersErrors) will 
_never_ happen. Walter is completely against them. From his point of view, the 
OS is _already_ checking this for you (hence the segfault or access 
violation), so there's no point in having the language check.

We might end up with something in druntime which prints out a stacktrace when 
a segfault occurs, but that's the closest that you'll ever get to a null 
pointer exception in D.

A non-nullable type _will_ be added to Phobos at some point. The issue is a 
matter of implementation. At least one has been submitted, but it wasn't good 
enough to be included as it stood. So, it hasn't been merged in. As soon as 
there is one which is good enough and has been appropriately reviewed by the 
Phobos devs, we'll have one. But until then, we don't.

- Jonathan M Davis
June 24, 2012
Re: Stack overflow
> A non-nullable type _will_ be added to Phobos at some point.

As struct or class or as built-in type?

And can me explain somebody why
[code]
@disable
this(typeof(null));
[/code]
print "Stack overflow"?
June 24, 2012
Re: Stack overflow
Am 24.06.2012 11:35, schrieb Namespace:
>> A non-nullable type _will_ be added to Phobos at some point.
>
> As struct or class or as built-in type?
>
> And can me explain somebody why
> [code]
> @disable
> this(typeof(null));
> [/code]
> print "Stack overflow"?


What should typeof(null) return you? void*, int*
June 24, 2012
Re: Stack overflow
On Sunday, 24 June 2012 at 10:37:39 UTC, David wrote:
> Am 24.06.2012 11:35, schrieb Namespace:
>>> A non-nullable type _will_ be added to Phobos at some point.
>>
>> As struct or class or as built-in type?
>>
>> And can me explain somebody why
>> [code]
>> @disable
>> this(typeof(null));
>> [/code]
>> print "Stack overflow"?
>
>
> What should typeof(null) return you? void*, int*

I don't understand, what do you mean?
1 2 3 4 5
Top | Discussion index | About this forum | D home