Re: D version of C# code

2017-04-16 Thread Joel via Digitalmars-d-learn
On Sunday, 16 April 2017 at 09:46:13 UTC, ag0aep6g wrote: On 04/16/2017 11:20 AM, Joel wrote: [...] void main() { // Arrange const string templateString = "My {pet} has {number} {ailment}."; auto pairs = [ "pet": "dog", "number": "5", "ailment": "fleas",

Re: Duplicated functions not reported?

2017-04-16 Thread Ola Fosheim Grostad via Digitalmars-d-learn
On Sunday, 16 April 2017 at 15:54:16 UTC, Stefan Koch wrote: sorting has O(n^2) worst case complexity. Therefore totaling to O(n^2) worst case again. Sorting with comparison is solved in O(n log n). If you have an upper limit on signature length then the problem is solvable for the whole prog

Re: Duplicated functions not reported?

2017-04-16 Thread Stefan Koch via Digitalmars-d-learn
On Sunday, 16 April 2017 at 17:10:14 UTC, Temtaime wrote: On Sunday, 16 April 2017 at 15:54:16 UTC, Stefan Koch wrote: On Sunday, 16 April 2017 at 10:56:37 UTC, Era Scarecrow wrote: On Saturday, 15 April 2017 at 11:10:01 UTC, Stefan Koch wrote: It would requires an O(n^2) check per declaration

Re: Duplicated functions not reported?

2017-04-16 Thread Temtaime via Digitalmars-d-learn
On Sunday, 16 April 2017 at 15:54:16 UTC, Stefan Koch wrote: On Sunday, 16 April 2017 at 10:56:37 UTC, Era Scarecrow wrote: On Saturday, 15 April 2017 at 11:10:01 UTC, Stefan Koch wrote: It would requires an O(n^2) check per declaration. Even it is never used. which would make imports that much

Re: Duplicated functions not reported?

2017-04-16 Thread Stefan Koch via Digitalmars-d-learn
On Sunday, 16 April 2017 at 10:56:37 UTC, Era Scarecrow wrote: On Saturday, 15 April 2017 at 11:10:01 UTC, Stefan Koch wrote: It would requires an O(n^2) check per declaration. Even it is never used. which would make imports that much more expensive. Seems wrong to me... If you made a list/

Re: Duplicated functions not reported?

2017-04-16 Thread Era Scarecrow via Digitalmars-d-learn
On Saturday, 15 April 2017 at 11:10:01 UTC, Stefan Koch wrote: It would requires an O(n^2) check per declaration. Even it is never used. which would make imports that much more expensive. Seems wrong to me... If you made a list/array of all the functions (based purely on signatures) then so

Re: D version of C# code

2017-04-16 Thread ag0aep6g via Digitalmars-d-learn
On 04/16/2017 11:20 AM, Joel wrote: What would you put instead of this C# code, in D? ```C# // Arrange const string templateString = "My {pet} has {number} {ailment}."; var pairs = new { pet = "dog", number = 5,

D version of C# code

2017-04-16 Thread Joel via Digitalmars-d-learn
What would you put instead of this C# code, in D? ```C# // Arrange const string templateString = "My {pet} has {number} {ailment}."; var pairs = new { pet = "dog", number = 5, ailment = "fleas",

Re: Stuck with DMD, and Unit-Threaded

2017-04-16 Thread drug via Digitalmars-d-learn
16.04.2017 11:20, Russel Winder via Digitalmars-d-learn пишет: There are points when you need to ask someone for help… I am trying to get Dub to build integration tests from test-source as a separate thing from building unit tests from source. The latter is easy and works, as does building the a

Re: Strange stack variable corruption error after calling extern(C) function

2017-04-16 Thread Stefan Koch via Digitalmars-d-learn
On Sunday, 16 April 2017 at 08:34:12 UTC, cc wrote: All this with extern(Windows) rather than extern(C) by the way. Why not use loadLibraryA ? then all the problems go away :) this is how derelict does it as well.

Re: Strange stack variable corruption error after calling extern(C) function

2017-04-16 Thread cc via Digitalmars-d-learn
All this with extern(Windows) rather than extern(C) by the way.

Stuck with DMD, and Unit-Threaded

2017-04-16 Thread Russel Winder via Digitalmars-d-learn
There are points when you need to ask someone for help… I am trying to get Dub to build integration tests from test-source as a separate thing from building unit tests from source. The latter is easy and works, as does building the application. I cannot however get the integration tests to build,

Re: SFML gcc - MacOS

2017-04-16 Thread Joel via Digitalmars-d-learn
On Sunday, 16 April 2017 at 07:53:49 UTC, Jacob Carlborg wrote: On 2017-04-16 03:52, Joel wrote: In getting DSFML (http://dsfml.com/) working. I found gcc takes for ever to install, is there some thing wrong? (I posted in https://github.com/Jebbs/DSFML, but no replies). Maybe just install Xcod

Re: Compilation problems with GDC/GCC

2017-04-16 Thread Johannes Pfau via Digitalmars-d-learn
Am Sat, 15 Apr 2017 14:01:51 + schrieb DRex : > On Saturday, 15 April 2017 at 13:08:29 UTC, DRex wrote: > > On Saturday, 15 April 2017 at 13:02:43 UTC, DRex wrote: > >> On Saturday, 15 April 2017 at 12:45:47 UTC, DRex wrote: > > > > Update to the Update, > > > > I fixed the lib failing to

Re: SFML gcc - MacOS

2017-04-16 Thread Jacob Carlborg via Digitalmars-d-learn
On 2017-04-16 03:52, Joel wrote: In getting DSFML (http://dsfml.com/) working. I found gcc takes for ever to install, is there some thing wrong? (I posted in https://github.com/Jebbs/DSFML, but no replies). Maybe just install Xcode CLT (some how), and uninstall gcc. I've had this problem for a wh

Re: Strange stack variable corruption error after calling extern(C) function

2017-04-16 Thread cc via Digitalmars-d-learn
Ok, I took another stab at this since I've had the problem sitting for however many months and I think I finally got it figured out. I needed to reimport the import library from the DLL (via implib.exe) WITHOUT the /system switch, then, on inspecting it, it appears the correct function names t