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

2018-11-30 Thread 12345swordy via Digitalmars-d-learn
On Friday, 30 November 2018 at 12:00:46 UTC, Atila Neves wrote: On Thursday, 29 November 2018 at 18:31:41 UTC, SimonN wrote: On Monday, 19 November 2018 at 21:23:31 UTC, Jordi Gutiérrez Hermoso wrote: When I was first playing with D, I managed to create a segfault What's the reasoning for

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

2018-11-30 Thread 12345swordy via Digitalmars-d-learn
On Friday, 30 November 2018 at 15:32:55 UTC, 12345swordy wrote: On Friday, 30 November 2018 at 12:00:46 UTC, Atila Neves wrote: On Thursday, 29 November 2018 at 18:31:41 UTC, SimonN wrote: On Monday, 19 November 2018 at 21:23:31 UTC, Jordi Gutiérrez Hermoso wrote: [...] [...] 100 % agree

Re: serve-d break on every update of vs code

2018-11-30 Thread Laurent Tréguier via Digitalmars-d-learn
On Friday, 30 November 2018 at 13:04:37 UTC, greatsam4sure wrote: vs code update every time I am connected to internet. Each time I accept the update my code-d stops to show autocomplete. what is the best way to solve this problem. Just updated today. These are the error report Installing

Re: what are the rules for @nogc and @safe attributes inference?

2018-11-30 Thread Neia Neutuladh via Digitalmars-d-learn
On Fri, 30 Nov 2018 20:41:03 +, ikod wrote: > I can't find the reason why nogc/nothrow can't be inferred in this case: > > class S(K,V) > { > auto get/*()*/(K a) { > return 0; > } > } > void main() @nogc nothrow { > S!(int, string) sia; > auto v = sia.get(1); > }

Re: serve-d break on every update of vs code

2018-11-30 Thread greatsam4sure via Digitalmars-d-learn
On Friday, 30 November 2018 at 14:38:14 UTC, WebFreak001 wrote: On Friday, 30 November 2018 at 13:04:37 UTC, greatsam4sure wrote: vs code update every time I am connected to internet. Each time I accept the update my code-d stops to show autocomplete. what is the best way to solve this

Re: what are the rules for @nogc and @safe attributes inference?

2018-11-30 Thread ikod via Digitalmars-d-learn
On Friday, 30 November 2018 at 21:03:06 UTC, Neia Neutuladh wrote: On Fri, 30 Nov 2018 20:41:03 +, ikod wrote: I can't find the reason why nogc/nothrow can't be inferred in this case: class S(K,V) { auto get/*()*/(K a) { return 0; } } void main() @nogc nothrow {

Re: serve-d break on every update of vs code

2018-11-30 Thread greatsam4sure via Digitalmars-d-learn
On Friday, 30 November 2018 at 16:24:35 UTC, Laurent Tréguier wrote: On Friday, 30 November 2018 at 13:04:37 UTC, greatsam4sure wrote: vs code update every time I am connected to internet. Each time I accept the update my code-d stops to show autocomplete. what is the best way to solve this

Template matches more than one template declaration error when trying to pass function's pointer

2018-11-30 Thread solidstate1991 via Digitalmars-d-learn
After some refactoring, there are four functions sharing the same name (technically four, but LDC didn't complain about them): @nogc void blitter(T)(T* src, T* dest, size_t length){...} and @nogc void blitter(T)(T* src, T* dest, size_t length, T* mask){...} I need the first one, but at

Re: serve-d break on every update of vs code

2018-11-30 Thread greatsam4sure via Digitalmars-d-learn
On Friday, 30 November 2018 at 23:02:13 UTC, WebFreak001 wrote: On Friday, 30 November 2018 at 22:37:02 UTC, greatsam4sure wrote: On Friday, 30 November 2018 at 16:24:35 UTC, Laurent Tréguier wrote: On Friday, 30 November 2018 at 13:04:37 UTC, greatsam4sure wrote: vs code update every time I

Re: serve-d break on every update of vs code

2018-11-30 Thread WebFreak001 via Digitalmars-d-learn
On Friday, 30 November 2018 at 22:37:02 UTC, greatsam4sure wrote: On Friday, 30 November 2018 at 16:24:35 UTC, Laurent Tréguier wrote: On Friday, 30 November 2018 at 13:04:37 UTC, greatsam4sure wrote: vs code update every time I am connected to internet. Each time I accept the update my code-d

Re: Template matches more than one template declaration error when trying to pass function's pointer

2018-11-30 Thread H. S. Teoh via Digitalmars-d-learn
On Sat, Dec 01, 2018 at 01:17:55AM +, solidstate1991 via Digitalmars-d-learn wrote: > After some refactoring, there are four functions sharing the same name > (technically four, but LDC didn't complain about them): > > @nogc void blitter(T)(T* src, T* dest, size_t length){...} > > and > >

Re: what are the rules for @nogc and @safe attributes inference?

2018-11-30 Thread Neia Neutuladh via Digitalmars-d-learn
On Fri, 30 Nov 2018 22:10:11 +, ikod wrote: > Thanks for explanation, got it. > > My case is actually > > interface I(K,V) > { > int get()(K); > } Interface functions must be abstract. Templated functions are implicitly final. Final things can't be abstract. If there's something

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

2018-11-30 Thread Tony via Digitalmars-d-learn
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 your code.

Re: getopt short-options documentation

2018-11-30 Thread Antonio Corbi via Digitalmars-d-learn
On Thursday, 29 November 2018 at 20:55:22 UTC, Daniel Kozak wrote: Are you sure? Can you show me an example? I always forgot on this limitation and somtimes it cause really nesty things :D On Thu, Nov 29, 2018 at 6:05 PM Antonio Corbi via Digitalmars-d-learn <

Re: gcc 9 vs. dmd?

2018-11-30 Thread welkam via Digitalmars-d-learn
On Friday, 30 November 2018 at 04:47:26 UTC, Andrew Pennebaker wrote: gcc is currently required for dmd on FreeBSD, as dmd links to libstdc++. Parts of dmd are still written in C++ but most of it was converted recently. More on that here: "DMD backend now in D"

Re: How to pass -J switch to compiler via DUB?

2018-11-30 Thread rikki cattermole via Digitalmars-d-learn
On 01/12/2018 12:05 AM, Andrey wrote: Hi, How to pass -J switch to compiler via DUB? I want to import some text file at compile time: string data = import("vertex.glsl"); In dub.json: "dflags": [     "-J=vertex.glsl" ] The file itself is located on the same level as "dub.json".

How to pass -J switch to compiler via DUB?

2018-11-30 Thread Andrey via Digitalmars-d-learn
Hi, How to pass -J switch to compiler via DUB? I want to import some text file at compile time: string data = import("vertex.glsl"); In dub.json: "dflags": [ "-J=vertex.glsl" ] The file itself is located on the same level as "dub.json".

Re: How to pass -J switch to compiler via DUB?

2018-11-30 Thread fghost via Digitalmars-d-learn
On Friday, 30 November 2018 at 11:05:26 UTC, Andrey wrote: Hi, How to pass -J switch to compiler via DUB? I want to import some text file at compile time: string data = import("vertex.glsl"); In dub.json: "dflags": [ "-J=vertex.glsl" ] The file itself is located on the same level as

Re: gcc 9 vs. dmd?

2018-11-30 Thread Jonathan M Davis via Digitalmars-d-learn
On Friday, November 30, 2018 2:43:41 AM MST welkam via Digitalmars-d-learn wrote: > On Friday, 30 November 2018 at 04:47:26 UTC, Andrew Pennebaker > > wrote: > > gcc is currently required for dmd on FreeBSD, as dmd links to > > libstdc++. > > Parts of dmd are still written in C++ but most of it

Re: How to pass -J switch to compiler via DUB?

2018-11-30 Thread Andrey via Digitalmars-d-learn
On Friday, 30 November 2018 at 11:21:04 UTC, fghost wrote: On Friday, 30 November 2018 at 11:05:26 UTC, Andrey wrote: Hi, How to pass -J switch to compiler via DUB? I want to import some text file at compile time: string data = import("vertex.glsl"); In dub.json: "dflags": [

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

2018-11-30 Thread Atila Neves via Digitalmars-d-learn
On Thursday, 29 November 2018 at 18:31:41 UTC, SimonN wrote: On Monday, 19 November 2018 at 21:23:31 UTC, Jordi Gutiérrez Hermoso wrote: When I was first playing with D, I managed to create a segfault What's the reasoning for allowing this? 100 % agree that there should be non-nullable

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

2018-11-30 Thread Atila Neves via Digitalmars-d-learn
On Friday, 30 November 2018 at 06:15:29 UTC, O-N-S (ozan) wrote: On Monday, 19 November 2018 at 21:23:31 On Monday, 19 November 2018 at 21:23:31 UTC, Jordi Gutiérrez Hermoso wrote: I'm not the only one who has done this. I can't find it right now, but I've seen at least one person open a bug

serve-d break on every update of vs code

2018-11-30 Thread greatsam4sure via Digitalmars-d-learn
vs code update every time I am connected to internet. Each time I accept the update my code-d stops to show autocomplete. what is the best way to solve this problem. Just updated today. These are the error report Installing into C:\Users\Greatsam\AppData\Roaming\code-d\bin git clone

Re: what are the rules for @nogc and @safe attributes inference?

2018-11-30 Thread ikod via Digitalmars-d-learn
On Thursday, 15 November 2018 at 21:55:18 UTC, Steven Schveighoffer wrote: On 11/15/18 4:09 PM, Adam D. Ruppe wrote: On Thursday, 15 November 2018 at 21:00:48 UTC, ikod wrote: what are the rules for @nogc inference? It attempts it if and only if it is a template. Well, the general "rule"

Re: serve-d break on every update of vs code

2018-11-30 Thread WebFreak001 via Digitalmars-d-learn
On Friday, 30 November 2018 at 13:04:37 UTC, greatsam4sure wrote: vs code update every time I am connected to internet. Each time I accept the update my code-d stops to show autocomplete. what is the best way to solve this problem. [...] hi, update dmd