Re: Alias sleep(int) for Thread.sleep(dur!("seconds")( int ));

2019-11-13 Thread Steven Schveighoffer via Digitalmars-d-learn
On 11/12/19 4:24 PM, Marcone wrote: I am using this function to sleep, but I want a simple Alias. How can I alias this? // Function sleep(int) void sleep(int seconds){ Thread.sleep(dur!("seconds")( seconds )); } sleep(1); // Using function. Thread.sleep(1.seconds); // not that bad imo.

Re: Alias sleep(int) for Thread.sleep(dur!("seconds")( int ));

2019-11-12 Thread Daniel Kozak via Digitalmars-d-learn
On Tue, Nov 12, 2019 at 11:50 PM Marcone via Digitalmars-d-learn wrote: > > > Can you make Alias for: > task!func().executeInNewThread(); > > Thank you! AFAIK that is not possible without some wrapper because executeInNewThread is member function of Task so it will need this reference for object

Re: Alias sleep(int) for Thread.sleep(dur!("seconds")( int ));

2019-11-12 Thread Marcone via Digitalmars-d-learn
On Tuesday, 12 November 2019 at 22:26:48 UTC, Daniel Kozak wrote: On Tuesday, 12 November 2019 at 21:24:54 UTC, Marcone wrote: I am using this function to sleep, but I want a simple Alias. How can I alias this? // Function sleep(int) void sleep(int seconds){

Re: Alias sleep(int) for Thread.sleep(dur!("seconds")( int ));

2019-11-12 Thread Marcone via Digitalmars-d-learn
On Tuesday, 12 November 2019 at 22:26:48 UTC, Daniel Kozak wrote: On Tuesday, 12 November 2019 at 21:24:54 UTC, Marcone wrote: I am using this function to sleep, but I want a simple Alias. How can I alias this? // Function sleep(int) void sleep(int seconds){

Re: Alias sleep(int) for Thread.sleep(dur!("seconds")( int ));

2019-11-12 Thread Daniel Kozak via Digitalmars-d-learn
On Tuesday, 12 November 2019 at 21:24:54 UTC, Marcone wrote: I am using this function to sleep, but I want a simple Alias. How can I alias this? // Function sleep(int) void sleep(int seconds){ Thread.sleep(dur!("seconds")( seconds )); } sleep(1); // Using function. You can do this:

Re: Alias sleep(int) for Thread.sleep(dur!("seconds")( int ));

2019-11-12 Thread Jonathan M Davis via Digitalmars-d-learn
On Tuesday, November 12, 2019 2:24:54 PM MST Marcone via Digitalmars-d-learn wrote: > I am using this function to sleep, but I want a simple Alias. How > can I alias this? > > // Function sleep(int) > void sleep(int seconds){ > Thread.sleep(dur!("seconds")( seconds )); > } > > sleep(1); //