Re: Passing C++ class to DLL for callbacks from D (Steam)

2018-06-09 Thread evilrat via Digitalmars-d-learn
On Sunday, 10 June 2018 at 01:35:40 UTC, cc wrote: On Saturday, 9 June 2018 at 14:11:13 UTC, evilrat wrote: However steam devs decided to shield actual pointer and return pointer sized integer when C API is used(or they just screw up?). Anyway, the pointers for subsystems returned by context

Re: WTF! new in class is static?!?!

2018-06-09 Thread KingJoffrey via Digitalmars-d-learn
On Sunday, 10 June 2018 at 01:27:50 UTC, bauss wrote: On Saturday, 9 June 2018 at 12:40:07 UTC, RealProgrammer wrote: maybe you and others in the D 'community' should start paying attention to the 'opinions' of those who do professional development with professional compilers. I do

Re: Passing C++ class to DLL for callbacks from D (Steam)

2018-06-09 Thread cc via Digitalmars-d-learn
On Saturday, 9 June 2018 at 14:11:13 UTC, evilrat wrote: However steam devs decided to shield actual pointer and return pointer sized integer when C API is used(or they just screw up?). Anyway, the pointers for subsystems returned by context calls on C++ API and mirrored C API calls are

Re: WTF! new in class is static?!?!

2018-06-09 Thread bauss via Digitalmars-d-learn
On Saturday, 9 June 2018 at 12:40:07 UTC, RealProgrammer wrote: maybe you and others in the D 'community' should start paying attention to the 'opinions' of those who do professional development with professional compilers. I do professional work with a professional compiler aka. The D

Re: How to task pool in vibe.d?

2018-06-09 Thread crimaniak via Digitalmars-d-learn
On Saturday, 9 June 2018 at 15:11:02 UTC, Computermatronic wrote: I'd like to create a bunch of tasks in vibe.d, then wait for them all to complete. Using std.concurrency and std.parallelism this is trivial. I could just spawn a bunch of vibe.d tasks and then iteratively join them, but I

Re: delegates and functions

2018-06-09 Thread Ali Çehreli via Digitalmars-d-learn
On 06/09/2018 02:09 PM, OlegZ wrote: On Saturday, 9 June 2018 at 20:55:21 UTC, drug wrote: In fact using `=>` you really define a function returning delegate. I see. Thanks. There is some explanation at the following page, of how the lambda syntax is related to the full syntax:

Re: delegates and functions

2018-06-09 Thread OlegZ via Digitalmars-d-learn
On Saturday, 9 June 2018 at 20:55:21 UTC, drug wrote: In fact using `=>` you really define a function returning delegate. I see. Thanks.

Re: delegates and functions

2018-06-09 Thread drug via Digitalmars-d-learn
On 09.06.2018 23:39, OlegZ wrote: On Saturday, 9 June 2018 at 20:03:15 UTC, OlegZ wrote: auto hz = (string s) => { writeln( s ); return cast( int )s.length; } How I should to write lambda of type "int delegate( string )? I found one way: auto hz = delegate int( string s ) { writeln( s );

Re: delegates and functions

2018-06-09 Thread OlegZ via Digitalmars-d-learn
On Saturday, 9 June 2018 at 20:03:15 UTC, OlegZ wrote: auto hz = (string s) => { writeln( s ); return cast( int )s.length; } How I should to write lambda of type "int delegate( string )? I found one way: auto hz = delegate int( string s ) { writeln( s ); return cast( int )s.length; }; but

delegates and functions

2018-06-09 Thread OlegZ via Digitalmars-d-learn
I want "int delegate( string )", but hz most probably is "int function( string )" auto hz = (string s) => { writeln( s ); return cast( int )s.length; }; but pragma (msg, typeid( (string s) => { writeln( s ); return cast( int )s.length; })); shows typeid( int delegate() @safe function(string

Re: WTF! new in class is static?!?!

2018-06-09 Thread aliak00 via Digitalmars-d-learn
On Friday, 8 June 2018 at 18:18:27 UTC, Jonathan M Davis wrote: On Thursday, June 07, 2018 22:43:50 aliak via Digitalmars-d-learn wrote: On Thursday, 7 June 2018 at 21:32:54 UTC, Jonathan M Davis wrote: > [...] Is that supposed to compile? -> https://run.dlang.io/is/SjUEOu Error: cannot use

How to task pool in vibe.d?

2018-06-09 Thread Computermatronic via Digitalmars-d-learn
I'd like to create a bunch of tasks in vibe.d, then wait for them all to complete. Using std.concurrency and std.parallelism this is trivial. I could just spawn a bunch of vibe.d tasks and then iteratively join them, but I would think vibe.d would provide some primitives for task-pooling.

Re: Passing C++ class to DLL for callbacks from D (Steam)

2018-06-09 Thread evilrat via Digitalmars-d-learn
On Saturday, 9 June 2018 at 03:14:13 UTC, cc wrote: On Saturday, 9 June 2018 at 03:07:39 UTC, cc wrote: I've put together a simplified test program here (124KB): Here is a pastebin of the D source file updated with some additional comments at the end with the callback class definitions from

Re: WTF! new in class is static?!?!

2018-06-09 Thread 12345swordy via Digitalmars-d-learn
On Saturday, 9 June 2018 at 13:49:48 UTC, 12345swordy wrote: No, because you been caught making imposter accounts left and right. Which btw we can tell as your poor attempts to imposter me. Well... why ya all r busy havin a go at me, the bugs remains (as do all D'other bugs).

Re: WTF! new in class is static?!?!

2018-06-09 Thread 12345swordy via Digitalmars-d-learn
On Saturday, 9 June 2018 at 13:24:49 UTC, KingJoffrey wrote: On Saturday, 9 June 2018 at 12:56:55 UTC, rikki cattermole wrote: But unlike you "king", Bauss isn't using tor to ban evade. why you wanna ban little old me? is it cause I made a crticism of D? No, because you been caught making

Re: WTF! new in class is static?!?!

2018-06-09 Thread KingJoffrey via Digitalmars-d-learn
On Saturday, 9 June 2018 at 12:56:55 UTC, rikki cattermole wrote: But unlike you "king", Bauss isn't using tor to ban evade. why you wanna ban little old me? is it cause I made a crticism of D? did i hurt your feelings? ..and everyone I know uses tor - and you should too - whether you're

Re: WTF! new in class is static?!?!

2018-06-09 Thread rikki cattermole via Digitalmars-d-learn
But unlike you "king", Bauss isn't using tor to ban evade.

Re: WTF! new in class is static?!?!

2018-06-09 Thread RealProgrammer via Digitalmars-d-learn
On Saturday, 9 June 2018 at 11:47:54 UTC, bauss wrote: Nobody cares about your opinion. Nobody is forcing you to write code like that. In fact most programs will be written without such code, for good reason. Regardless if it does the "correct" thing or not. Dude. That response is so

Re: WTF! new in class is static?!?!

2018-06-09 Thread bauss via Digitalmars-d-learn
On Saturday, 9 June 2018 at 09:24:48 UTC, KingJoffrey wrote: On Thursday, 7 June 2018 at 21:57:17 UTC, Steven Schveighoffer wrote: Yep, long-standing issue: https://issues.dlang.org/show_bug.cgi?id=2947 Almost a decade old! -Steve Another reason why I still refuse to bring my code to D.

Re: Is DWT busted?

2018-06-09 Thread Andrea Fontana via Digitalmars-d-learn
On Friday, 8 June 2018 at 05:00:57 UTC, TheGag96 wrote: I'm sorry about bringing this into here instead of DWT's subforum, but it's somewhat dead and hasn't been getting a lot of attention. I decided to finally play around with DWT today and tried to build the example. It's a known bug. I

Re: WTF! new in class is static?!?!

2018-06-09 Thread KingJoffrey via Digitalmars-d-learn
On Thursday, 7 June 2018 at 21:57:17 UTC, Steven Schveighoffer wrote: Yep, long-standing issue: https://issues.dlang.org/show_bug.cgi?id=2947 Almost a decade old! -Steve Another reason why I still refuse to bring my code to D. As if the module not respecting class encapsulation was not

Re: Is DWT busted?

2018-06-09 Thread MGW via Digitalmars-d-learn
On Friday, 8 June 2018 at 05:00:57 UTC, TheGag96 wrote: I'm sorry about bringing this into here instead of DWT's subforum, but it's somewhat dead and hasn't been getting a lot of attention. I decided to finally play around with DWT today and tried to build the example. I got this: Performing