Re: Shutdown signals

2021-05-10 Thread Tim via Digitalmars-d-learn
On Monday, 10 May 2021 at 23:55:18 UTC, Adam D. Ruppe wrote: On Monday, 10 May 2021 at 23:35:06 UTC, Tim wrote: [...] dpldocs.info/signal it comes up as the second result. The C function you call from there (on linux anyway) is sigaction. A little copy/paste out of my terminal.d: ```d

Re: can I reuse statements?

2021-05-10 Thread Jack via Digitalmars-d-learn
On Monday, 10 May 2021 at 21:10:13 UTC, Paul Backus wrote: On Monday, 10 May 2021 at 21:01:53 UTC, Jack wrote: [...] You can do it with a string mixin: ```d // Note: q{ ... } creates a "token string", a special kind of string literal // that's used for code strings. // See https://dlang.org

Re: Shutdown signals

2021-05-10 Thread Adam D. Ruppe via Digitalmars-d-learn
On Monday, 10 May 2021 at 23:35:06 UTC, Tim wrote: I can't find that in the docs, nor in dpldocs. Can you help out with this? dpldocs.info/signal it comes up as the second result. The C function you call from there (on linux anyway) is sigaction. A little copy/paste out of my terminal.d: ``

Re: Shutdown signals

2021-05-10 Thread Tim via Digitalmars-d-learn
On Monday, 10 May 2021 at 23:31:11 UTC, Adam D. Ruppe wrote: On Monday, 10 May 2021 at 23:20:47 UTC, Tim wrote: Hi all, How can I get a D program to detect something a keyboard interrupt so I shut things down in a specific way? import core.sys.posix.signal; then you can use the same functio

Re: Shutdown signals

2021-05-10 Thread Adam D. Ruppe via Digitalmars-d-learn
On Monday, 10 May 2021 at 23:20:47 UTC, Tim wrote: Hi all, How can I get a D program to detect something a keyboard interrupt so I shut things down in a specific way? import core.sys.posix.signal; then you can use the same functions as C to set signal handlers.

Shutdown signals

2021-05-10 Thread Tim via Digitalmars-d-learn
Hi all, How can I get a D program to detect something a keyboard interrupt so I shut things down in a specific way?

Re: can I reuse statements?

2021-05-10 Thread Paul Backus via Digitalmars-d-learn
On Monday, 10 May 2021 at 21:01:53 UTC, Jack wrote: mixin template seems to allow only declarations so if I put a if or case-statement in the body it doesn't work. I'd like to make something like this work: ```d switch(code) { case X, Y: // that specific case repeat

can I reuse statements?

2021-05-10 Thread Jack via Digitalmars-d-learn
mixin template seems to allow only declarations so if I put a if or case-statement in the body it doesn't work. I'd like to make something like this work: ```d switch(code) { case X, Y: // that specific case repeats alot in the code in different procedures

Re: Remove own post from forum

2021-05-10 Thread IGotD- via Digitalmars-d-learn
On Monday, 10 May 2021 at 03:36:02 UTC, Виталий Фадеев wrote: I have missformated post in thread: https://forum.dlang.org/thread/kwpqyzwgczdpzgsvo...@forum.dlang.org Say, please, how to remove own post from this forum ? Welcome to the 90s, this forum is essentially a front end to a news grou

Re: Remove own post from forum

2021-05-10 Thread Alain De Vos via Digitalmars-d-learn
You will be remembered until eternity :)

Re: Remove own post from forum

2021-05-10 Thread cmyka via Digitalmars-d-learn
On Monday, 10 May 2021 at 11:29:04 UTC, Berni44 wrote: On Monday, 10 May 2021 at 10:00:11 UTC, Виталий Фадеев wrote: Say, please, how to remove own post from this forum ? There's currently no way to remove or edit an existing post. ok In my opinion it is a violation of the GDPR, which give

Re: Remove own post from forum

2021-05-10 Thread Berni44 via Digitalmars-d-learn
On Monday, 10 May 2021 at 10:00:11 UTC, Виталий Фадеев wrote: Say, please, how to remove own post from this forum ? There's currently no way to remove or edit an existing post. ok In my opinion it is a violation of the GDPR, which gives you the right to remove such posts. GDPR applies here

Re: moveToGC

2021-05-10 Thread Alain De Vos via Digitalmars-d-learn
Something else with, import core.memory i've got, undefined identifier moveToGC

Re: type of functions

2021-05-10 Thread Simen Kjærås via Digitalmars-d-learn
On Monday, 10 May 2021 at 10:37:51 UTC, Alain De Vos wrote: Can I say that the compiler is intelligent enough to add the attributes "pure nothrow @nogc @safe" ? Yes, in those cases (and some others). The functionality is described here: https://dlang.org/spec/function.html#function-attribute-

Re: moveToGC

2021-05-10 Thread Mike Parker via Digitalmars-d-learn
On Monday, 10 May 2021 at 10:56:35 UTC, JG wrote: The following compiles with dmd but not with ldc on run.dlang.io. Am I doing something wrong? Please provide the error message(s) when asking questions like this. In this case: ``` onlineapp.d(15): Error: undefined identifier moveToGC onlinea

moveToGC

2021-05-10 Thread JG via Digitalmars-d-learn
The following compiles with dmd but not with ldc on run.dlang.io. Am I doing something wrong? import core.memory; void main() { struct S { int x; this(this) @disable; ~this() @safe pure nothrow @nogc {} } S* p;

type of functions

2021-05-10 Thread Alain De Vos via Digitalmars-d-learn
I've written a small program and also it's output, ``` import std.stdio; double myfun(int x) pure nothrow @nogc @safe{ return x/10.0; } void main() { static double Gfunction(int x) {return x/10.0;} writeln(typeid(typeof(Gfunction))); //OUTPUT:"double function(int) pure nothrow @nogc

Re: Remove own post from forum

2021-05-10 Thread Виталий Фадеев via Digitalmars-d-learn
On Monday, 10 May 2021 at 04:29:29 UTC, Paul Backus wrote: On Monday, 10 May 2021 at 03:36:02 UTC, Виталий Фадеев wrote: I have missformated post in thread: https://forum.dlang.org/thread/kwpqyzwgczdpzgsvo...@forum.dlang.org Say, please, how to remove own post from this forum ? There's curre