Re: GDC generate wrong .exe ("not a valid win32 application")

2017-06-23 Thread PATRIC DEXHEIMER via Digitalmars-d-learn
On Wednesday, 21 June 2017 at 15:55:27 UTC, David Nadlinger wrote: On Monday, 19 June 2017 at 14:08:56 UTC, Patric Dexheimer wrote: Fresh install of GDC. (tried with 32x ad 32_64x) Where did you get the GDC executable from? The GDC project doesn't currently offer any official builds that

Re: GDC generate wrong .exe ("not a valid win32 application")

2017-06-19 Thread Patric Dexheimer via Digitalmars-d-learn
On Monday, 19 June 2017 at 23:55:54 UTC, rjframe wrote: On Mon, 19 Jun 2017 14:08:56 +, Patric Dexheimer wrote: Fresh install of GDC. (tried with 32x ad 32_64x) GDC: 6.3.0 DUB: 1.3.0 dub run --build=release --arch=x86 --compiler=gdc (...) Running .\main Failed to spawn new process (%1

GDC generate wrong .exe ("not a valid win32 application")

2017-06-19 Thread Patric Dexheimer via Digitalmars-d-learn
Fresh install of GDC. (tried with 32x ad 32_64x) GDC: 6.3.0 DUB: 1.3.0 dub run --build=release --arch=x86 --compiler=gdc (...) Running .\main Failed to spawn new process (%1 is not a valid win32 application)

Re: function overload with mixin template bug?

2017-05-17 Thread Patric Dexheimer via Digitalmars-d-learn
On Wednesday, 17 May 2017 at 13:26:36 UTC, Adam D. Ruppe wrote: On Wednesday, 17 May 2017 at 13:13:06 UTC, Patric Dexheimer wrote: Function overloads coming from mixin templates are not being detected ? A name being present in the struct means that name is NOT pulled from the mixin template.

function overload with mixin template bug?

2017-05-17 Thread Patric Dexheimer via Digitalmars-d-learn
1) struct T{ void f1(){writeln("default f1");} void f1(int x){writeln("overload f1");} } //main T().f1(); T().f1(1); //compiles and output as expected. 2) mixin template add_function(){ void f1(){writeln("default f1");} } struct T{ mixin add_function; void f1(int

Re: opCall with struct alias this

2017-05-05 Thread Patric Dexheimer via Digitalmars-d-learn
On Friday, 5 May 2017 at 13:19:03 UTC, Adam D. Ruppe wrote: On Friday, 5 May 2017 at 13:05:35 UTC, Patric Dexheimer wrote: [...] You should never use static opCall. They are ambiguous with non-static opCall as well as with constructors. It is a buggy mess that should never have been in the

opCall with struct alias this

2017-05-05 Thread Patric Dexheimer via Digitalmars-d-learn
struct Base(T){ static T opCall(Args...)( Args args ){ writeln(args); writeln("opCall"); T t; return t; } } struct Data{ Base!Data b; alias b this; } void main() { // Expected: opCall

Re: [Semi-OT] I don't want to leave this language!

2016-12-08 Thread Patric Dexheimer via Digitalmars-d-learn
On Thursday, 8 December 2016 at 12:10:55 UTC, Andrey wrote: On Thursday, 8 December 2016 at 11:09:12 UTC, ketmar wrote: what can be done, tho, is article (or series of articles) describing what exactly druntime is, how it is compared to libc and libc++, why it doesn't hurt at all, how to do

Re: the best language I have ever met(?)

2016-11-21 Thread Patric Dexheimer via Digitalmars-d-learn
On Saturday, 19 November 2016 at 00:47:00 UTC, ketmar wrote: On Saturday, 19 November 2016 at 00:28:36 UTC, Stefan Koch wrote: Please don't post non-d. it slipped accidentally, sorry. ;-) for OP: `uint[2] a = [42, 69];` is the correct syntax. "uint[$] a = [42, 69];" haha for a moment I

Re: ReturnType and Parameters of Templated function/method

2016-10-13 Thread Patric Dexheimer via Digitalmars-d-learn
On Thursday, 13 October 2016 at 21:07:17 UTC, ketmar wrote: On Thursday, 13 October 2016 at 20:52:09 UTC, Patric Dexheimer wrote: So for now my idea is to brute force the numbers of arguments with 'compiles' trait or trying to get the sourcecode somehow. depending on source code form (even if

Re: ReturnType and Parameters of Templated function/method

2016-10-13 Thread Patric Dexheimer via Digitalmars-d-learn
On Thursday, 13 October 2016 at 18:01:25 UTC, Ali Çehreli wrote: On 10/13/2016 07:19 AM, Patric Dexheimer wrote: There is a way to capture the return type/parameters of a templated function like: void add(T)(T t){} Parameters!add; Yes, i know that the template don´t have any type until

ReturnType and Parameters of Templated function/method

2016-10-13 Thread Patric Dexheimer via Digitalmars-d-learn
There is a way to capture the return type/parameters of a templated function like: void add(T)(T t){} Parameters!add; Yes, i know that the template don´t have any type until explicitly coded like: Parameters!(add!int); Or another solution like getting the string function declaration will

Re: Struct immutable data and dict

2016-10-06 Thread Patric Dexheimer via Digitalmars-d-learn
On Thursday, 6 October 2016 at 03:48:22 UTC, Mike Parker wrote: On Thursday, 6 October 2016 at 03:05:18 UTC, Patric Dexheimer wrote: [...] There's a difference between initialization and assignment. [...] On Thursday, 6 October 2016 at 03:48:22 UTC, Mike Parker wrote: On Thursday, 6

Re: Struct immutable data and dict

2016-10-05 Thread Patric Dexheimer via Digitalmars-d-learn
On Thursday, 6 October 2016 at 02:09:44 UTC, Adam D. Ruppe wrote: On Thursday, 6 October 2016 at 01:23:35 UTC, Patric Dexheimer wrote: Why? Because you'd be overwriting that immutable member. Structs just put structure around their contents, but it doesn't change their nature. That struct

Struct immutable data and dict

2016-10-05 Thread Patric Dexheimer via Digitalmars-d-learn
struct Test{ immutable size_t id; } Test[string] dict; Test[] array; void main(){ array~=Test(1);//work dict["teste"] = Test(1); //fail ?? } "Error: cannot modify struct dict["teste"] Test with immutable members" Why?

Window x64, LDC, Derelict : unable to compile

2016-09-15 Thread Patric Dexheimer via Digitalmars-d-learn
LLVM D compiler (1a7070): based on DMD v2.071.2-b2 and LLVM 3.9.0git-fbbabf3 command: dub run --build=release --arch=x86_64 --compiler=D:/ldc/bin/ldc2.exe Output: Performing "release" build using D:/ldc/bin/ldc2.exe for x86_64. derelict-util 2.0.6: building configuration "library"... Error:

Re: Fibers, what for?

2016-06-12 Thread Patric Dexheimer via Digitalmars-d-learn
On Monday, 13 June 2016 at 00:57:11 UTC, Alex Parrill wrote: Also note that Vibe.d, the largest fiber-based framework D has to offer, is capable of running several coroutines in parallel on multiple threads, meaning you must use the same level of synchronization as if you were using threads.

Fibers, what for?

2016-06-11 Thread Patric Dexheimer via Digitalmars-d-learn
I learned about Fibers on D, and now i´m starting to read about it (Threads/Fibers/Coroutines) etc. But when i try to make something usefull with it i just fail to see the real advantage over a normal structured programming without it. Can someone show some code with