Re: Read Once then reset/init value?

2019-11-03 Thread Robert M. Münch via Digitalmars-d-learn
On 2019-10-29 23:28:35 +, Simen Kjærås said: On Tuesday, 29 October 2019 at 22:24:20 UTC, Robert M. Münch wrote: I quite often have the pattern where a value should be read just once and after this reset itself. The idea is to avoid that others read the value by accident and get an older

Re: Mimicking Java's Type Erasure

2019-11-03 Thread Superstar64 via Digitalmars-d-learn
On Monday, 4 November 2019 at 01:25:36 UTC, Heromyth wrote: On Monday, 4 November 2019 at 00:16:53 UTC, Superstar64 wrote: Consider the following Java code. -- import java.util.function.Function; public class Main{ //basic Rank2 type static interface Stringer{ String

Re: Mimicking Java's Type Erasure

2019-11-03 Thread Heromyth via Digitalmars-d-learn
On Monday, 4 November 2019 at 00:16:53 UTC, Superstar64 wrote: Consider the following Java code. -- import java.util.function.Function; public class Main{ //basic Rank2 type static interface Stringer{ String show(Function type, A that); } static class Say implements

Re: Alternative to C++ macro in D

2019-11-03 Thread Ali Çehreli via Digitalmars-d-learn
On 11/03/2019 08:55 AM, Vinod K Chandran wrote: > Hi all, > I can do this in C++. > #include > using namespace std ; > > #define end }; > #define log(x) cout << x << endl > #define wait std::cin.get() There is nothing that stops one from using the C++ preprocessor on any text file. For

Mimicking Java's Type Erasure

2019-11-03 Thread Superstar64 via Digitalmars-d-learn
Consider the following Java code. -- import java.util.function.Function; public class Main{ //basic Rank2 type static interface Stringer{ String show(Function type, A that); } static class Say implements Stringer { public String show(Function type, A that){

Re: Which is the active fork in DFL gui library ?

2019-11-03 Thread Jesse Phillips via Digitalmars-d-learn
On Sunday, 3 November 2019 at 16:48:52 UTC, Vinod K Chandran wrote: On Sunday, 3 November 2019 at 14:01:03 UTC, Jesse Phillips https://github.com/Rayerd/dfl @Jesse Phillips, Thank you for the reply. Does DWT is built upon Java's SWT ? I heard that SWT is somewhat slower in windows.

Re: Alternative to C++ macro in D

2019-11-03 Thread Meta via Digitalmars-d-learn
On Sunday, 3 November 2019 at 16:55:36 UTC, Vinod K Chandran wrote: Hi all, I can do this in C++. #include using namespace std ; #define end }; #define log(x) cout << x << endl #define wait std::cin.get() int main() { log("Trying to avoid the visual clutter aused by closing curly

Re: Alternative to C++ macro in D

2019-11-03 Thread Sebastiaan Koppe via Digitalmars-d-learn
On Sunday, 3 November 2019 at 16:55:36 UTC, Vinod K Chandran wrote: int main() { log("Trying to avoid the visual clutter aused by closing curly braces") ; string myStr = "Now, code looks more elegant" ; log(myStr) ; wait ; end How can i do this in D ? Especially the " #define

Re: Alternative to C++ macro in D

2019-11-03 Thread Alexandru Ermicioi via Digitalmars-d-learn
On Sunday, 3 November 2019 at 16:55:36 UTC, Vinod K Chandran wrote: Hi all, I can do this in C++. #include using namespace std ; #define end }; #define log(x) cout << x << endl #define wait std::cin.get() int main() { log("Trying to avoid the visual clutter aused by closing curly

Re: Alternative to C++ macro in D

2019-11-03 Thread Alexandru Ermicioi via Digitalmars-d-learn
On Sunday, 3 November 2019 at 17:02:30 UTC, Vinod K Chandran wrote: On Sunday, 3 November 2019 at 16:55:36 UTC, Vinod K Chandran wrote: Hi all, I can do this in C++. #include using namespace std ; #define end }; #define log(x) cout << x << endl #define wait std::cin.get() int main() {

Re: Alternative to C++ macro in D

2019-11-03 Thread Vinod K Chandran via Digitalmars-d-learn
On Sunday, 3 November 2019 at 16:55:36 UTC, Vinod K Chandran wrote: Hi all, I can do this in C++. #include using namespace std ; #define end }; #define log(x) cout << x << endl #define wait std::cin.get() int main() { log("Trying to avoid the visual clutter aused by closing curly

Alternative to C++ macro in D

2019-11-03 Thread Vinod K Chandran via Digitalmars-d-learn
Hi all, I can do this in C++. #include using namespace std ; #define end }; #define log(x) cout << x << endl #define wait std::cin.get() int main() { log("Trying to avoid the visual clutter aused by closing curly braces") ; string myStr = "Now, code looks more elegant" ;

Re: Which is the active fork in DFL gui library ?

2019-11-03 Thread Vinod K Chandran via Digitalmars-d-learn
On Sunday, 3 November 2019 at 07:07:42 UTC, Mike Parker wrote: On Sunday, 3 November 2019 at 07:06:12 UTC, Mike Parker wrote: Here's an example, winhello.d, that should work with all of the following command lines: Sorry, here's the example: == winhello.d /+ dub.sdl: name "entry"

Re: Which is the active fork in DFL gui library ?

2019-11-03 Thread Vinod K Chandran via Digitalmars-d-learn
On Sunday, 3 November 2019 at 14:01:03 UTC, Jesse Phillips wrote: On Saturday, 2 November 2019 at 20:01:27 UTC, Vinod K Chandran wrote: Hi all, I just found that DFL gui library very interesting. But after some searching, i can see that DFL is inactive and there is few other forks for it. So

Re: Which is the active fork in DFL gui library ?

2019-11-03 Thread Jesse Phillips via Digitalmars-d-learn
On Saturday, 2 November 2019 at 20:01:27 UTC, Vinod K Chandran wrote: Hi all, I just found that DFL gui library very interesting. But after some searching, i can see that DFL is inactive and there is few other forks for it. So this is my question - Which fork is good for a gui development in

Re: Which is the active fork in DFL gui library ?

2019-11-03 Thread Mike Parker via Digitalmars-d-learn
On Saturday, 2 November 2019 at 20:01:27 UTC, Vinod K Chandran wrote: Hi all, I just found that DFL gui library very interesting. But after some searching, i can see that DFL is inactive and there is few other forks for it. So this is my question - Which fork is good for a gui development in

Re: Which is the active fork in DFL gui library ?

2019-11-03 Thread Mike Parker via Digitalmars-d-learn
On Sunday, 3 November 2019 at 07:06:12 UTC, Mike Parker wrote: Here's an example, winhello.d, that should work with all of the following command lines: Sorry, here's the example: == winhello.d /+ dub.sdl: name "entry" dflags "-L/SUBSYSTEM:WINDOWS" "-L/ENTRY:mainCRTStartup"