Re: What is the point of nothrow?

2018-06-11 Thread Dave Jones via Digitalmars-d-learn
On Monday, 11 June 2018 at 00:47:27 UTC, Jonathan M Davis wrote: On Sunday, June 10, 2018 23:59:17 Bauss via Digitalmars-d-learn wrote: What is the point of nothrow if it can only detect when Exception is thrown and not when Error is thrown? It seems like the attribute is useless because you

Re: Confusion/trying to understand CTFE keywords

2018-06-03 Thread Dave Jones via Digitalmars-d-learn
On Sunday, 3 June 2018 at 21:32:06 UTC, gdelazzari wrote: Note that this is not an attack to the language or anything (I actually really love it), I'm just trying to understand the reasoning behind this choice. Because they have a thing about not adding new keywords, apparently it's more

Re: inline asm return values

2018-03-25 Thread Dave Jones via Digitalmars-d-learn
On Sunday, 25 March 2018 at 12:23:03 UTC, kinke wrote: On Sunday, 25 March 2018 at 10:58:37 UTC, Dave Jones wrote: Is this stuff documented somewhere? See https://dlang.org/spec/abi.html#function_calling_conventions. It defines the D calling convention for Win32 (int return value in EAX)

inline asm return values

2018-03-25 Thread Dave Jones via Digitalmars-d-learn
Given this... int mulDiv64(int a, int b, int c) { asm { movEAX,a; imul b; idiv c; } } which computes a*b/c, with the intermediate value in 64 bit. It returns value that is left in EAX. Is this stuff documented somewhere? I mean I found the page on

Re: float.max + 1.0 does not overflow

2017-12-28 Thread Dave Jones via Digitalmars-d-learn
On Wednesday, 27 December 2017 at 14:14:42 UTC, Benjamin Thaut wrote: On Wednesday, 27 December 2017 at 13:40:28 UTC, rumbu wrote: Is that normal? It computes the difference between float.max and the next smaller reprensentable number in floating point. The difference printed by the program

Re: inout after function

2017-11-26 Thread Dave Jones via Digitalmars-d-learn
On Sunday, 26 November 2017 at 04:51:08 UTC, Adam D. Ruppe wrote: On Sunday, 26 November 2017 at 01:35:01 UTC, Dave Jones wrote: So it makes it a const/immutable/mutable method depending on whether the instance it is called on is const/immutable/mutable? On the outside, yes. So

Re: inout after function

2017-11-25 Thread Dave Jones via Digitalmars-d-learn
On Saturday, 25 November 2017 at 21:59:54 UTC, Ali Çehreli wrote: On 11/25/2017 01:51 PM, Dave Jones wrote: > What does the "inout" after front() do here... > > > @property ref inout(T) front() inout > { > assert(_data.refCountedStore.isInitialized); > return _data._payload[0]; > } > >

inout after function

2017-11-25 Thread Dave Jones via Digitalmars-d-learn
What does the "inout" after front() do here... @property ref inout(T) front() inout { assert(_data.refCountedStore.isInitialized); return _data._payload[0]; } Cant seem to find an explanation in the docs or forums :(

Re: Floating point types default to NaN?

2017-11-25 Thread Dave Jones via Digitalmars-d-learn
On Friday, 24 November 2017 at 22:38:49 UTC, Jonathan M Davis wrote: On Friday, November 24, 2017 20:43:14 A Guy With a Question via Digitalmars- d-learn wrote: On Friday, 24 November 2017 at 14:43:24 UTC, Adam D. Ruppe That requires data flow analysis, which the compiler doesn't do a lot of,