Re: Why is stdio ... stdio?

2018-11-10 Thread Jonathan M Davis via Digitalmars-d-learn
On Saturday, November 10, 2018 7:51:36 PM MST Adam D. Ruppe via Digitalmars- d-learn wrote: > On Saturday, 10 November 2018 at 23:29:12 UTC, Jonathan M Davis > > wrote: > > The fact that they got added to ddoc just further degrades it > > as a proper, macro-based markup language. > > The backticks

Re: Why is stdio ... stdio?

2018-11-10 Thread Adam D. Ruppe via Digitalmars-d-learn
On Saturday, 10 November 2018 at 23:29:12 UTC, Jonathan M Davis wrote: The fact that they got added to ddoc just further degrades it as a proper, macro-based markup language. The backticks were added to ddoc because they enabled something that was *virtually impossible* in ddoc before -

Re: dip1000: why can't the addressee come into existence later?

2018-11-10 Thread Neia Neutuladh via Digitalmars-d-learn
On Sat, 10 Nov 2018 16:25:40 +, Stanislav Blinov wrote: > Yep, you just over-simplified the first case. It is too simple to clearly illustrate why the code is invalid, but not so simple that the compiler accepts that code. > Consider: > > int* p; > { > int i; > p = > } > *p =

Re: How do I install a library?

2018-11-10 Thread greatsam4sure via Digitalmars-d-learn
On Saturday, 10 November 2018 at 20:04:21 UTC, aberba wrote: On Thursday, 8 November 2018 at 23:51:39 UTC, bachmeier wrote: On Thursday, 8 November 2018 at 23:43:38 UTC, Murilo wrote: It finally worked, but I can't just compile it normally, I have to use dub run, I wish it were something

Re: Why is stdio ... stdio?

2018-11-10 Thread Jonathan M Davis via Digitalmars-d-learn
On Saturday, November 10, 2018 6:53:14 AM MST Kagamin via Digitalmars-d- learn wrote: > On Friday, 9 November 2018 at 09:11:37 UTC, Jonathan M Davis > > wrote: > > No, I didn't. I just used underscores, which has been used with > > plain text for emphasis for decades. Supporting markdown, would >

Re: How do I use null in a struct?

2018-11-10 Thread Sebastiaan Koppe via Digitalmars-d-learn
On Saturday, 10 November 2018 at 19:42:47 UTC, Václav Kozák wrote: I'm making a Rest API with vibe.d and I have a struct User. Sometimes I need to return only a few of the fields. So for example: return User(1, null, "John", null, null, ...); If I do this, an error occurs: cannot implicitly

Re: How do I use null in a struct?

2018-11-10 Thread drug via Digitalmars-d-learn
On 10.11.2018 22:42, Václav Kozák wrote: I'm making a Rest API with vibe.d and I have a struct User. Sometimes I need to return only a few of the fields. So for example: return User(1, null, "John", null, null, ...); If I do this, an error occurs: cannot implicitly convert expression null of

Re: Why is stdio ... stdio?

2018-11-10 Thread Patrick Schluter via Digitalmars-d-learn
On Saturday, 10 November 2018 at 18:47:19 UTC, Chris Katko wrote: On Saturday, 10 November 2018 at 13:53:14 UTC, Kagamin wrote: [...] There is another possibility. Have the website run (fallible) heuristics to detect a snippet of code and automatically generate it. That would leave the

Re: How do I install a library?

2018-11-10 Thread aberba via Digitalmars-d-learn
On Thursday, 8 November 2018 at 23:51:39 UTC, bachmeier wrote: On Thursday, 8 November 2018 at 23:43:38 UTC, Murilo wrote: It finally worked, but I can't just compile it normally, I have to use dub run, I wish it were something simple that I just download into the folder and then use an

How do I use null in a struct?

2018-11-10 Thread Václav Kozák via Digitalmars-d-learn
I'm making a Rest API with vibe.d and I have a struct User. Sometimes I need to return only a few of the fields. So for example: return User(1, null, "John", null, null, ...); If I do this, an error occurs: cannot implicitly convert expression null of type typeof(null) to ... Thanks.

Re: Why is stdio ... stdio?

2018-11-10 Thread Chris Katko via Digitalmars-d-learn
On Saturday, 10 November 2018 at 13:53:14 UTC, Kagamin wrote: On Friday, 9 November 2018 at 09:11:37 UTC, Jonathan M Davis wrote: No, I didn't. I just used underscores, which has been used with plain text for emphasis for decades. Supporting markdown, would involve stuff like backticks for

Re: dip1000: why can't the addressee come into existence later?

2018-11-10 Thread Stanislav Blinov via Digitalmars-d-learn
On Saturday, 10 November 2018 at 06:56:29 UTC, Neia Neutuladh wrote: The following code doesn't work with @safe -dip1000: int* p; int i; p = i has a shorter lifetime than p, the compiler complains. But this code does: int i; int* p; p = The compiler does this even

Re: Reading into the output of a long running shellExecute

2018-11-10 Thread JN via Digitalmars-d-learn
On Saturday, 10 November 2018 at 15:05:38 UTC, helxi wrote: Hi. I have not done any multi-threaded programming before. What I basically want is to read into the output of a long shellExecute function each second. In details, I am calling shellExecute("pkexec dd if=/path/to/file of=/dev/sdx

Re: dip1000: why can't the addressee come into existence later?

2018-11-10 Thread Neia Neutuladh via Digitalmars-d-learn
On Sat, 10 Nov 2018 11:47:24 +, Nicholas Wilson wrote: > On Saturday, 10 November 2018 at 06:56:29 UTC, Neia Neutuladh wrote: >> Is this right? > > Are you sure you added @safe to the second example? > https://run.dlang.io/is/2RbOwK fails to compile. Maybe take another look at the post

Reading into the output of a long running shellExecute

2018-11-10 Thread helxi via Digitalmars-d-learn
Hi. I have not done any multi-threaded programming before. What I basically want is to read into the output of a long shellExecute function each second. In details, I am calling shellExecute("pkexec dd if=/path/to/file of=/dev/sdx status=progress && sync"); It's a long running process and dd

Re: Why is stdio ... stdio?

2018-11-10 Thread Kagamin via Digitalmars-d-learn
On Friday, 9 November 2018 at 09:11:37 UTC, Jonathan M Davis wrote: No, I didn't. I just used underscores, which has been used with plain text for emphasis for decades. Supporting markdown, would involve stuff like backticks for code highlighting Backticks are from ddoc. What's the other way

Re: dip1000: why can't the addressee come into existence later?

2018-11-10 Thread Nicholas Wilson via Digitalmars-d-learn
On Saturday, 10 November 2018 at 06:56:29 UTC, Neia Neutuladh wrote: Is this right? Are you sure you added @safe to the second example? https://run.dlang.io/is/2RbOwK fails to compile.