Re: dub windows unrecognised file extension a

2018-09-08 Thread Nicholas Wilson via Digitalmars-d-learn
On Sunday, 9 September 2018 at 04:53:05 UTC, Nicholas Wilson wrote: On Sunday, 9 September 2018 at 04:01:30 UTC, Nicholas Wilson wrote: On windows with dub it seems to be creating libfoo.a instead of foo.lib, I don't think I changed any settings. Old build based on 2.078 DMDFE seem to have buil

Re: dub windows unrecognised file extension a

2018-09-08 Thread Nicholas Wilson via Digitalmars-d-learn
On Sunday, 9 September 2018 at 04:01:30 UTC, Nicholas Wilson wrote: On windows with dub it seems to be creating libfoo.a instead of foo.lib, I don't think I changed any settings. Old build based on 2.078 DMDFE seem to have built .lib but LDC based on 2.082 seems to be building .a This definit

dub windows unrecognised file extension a

2018-09-08 Thread Nicholas Wilson via Digitalmars-d-learn
On windows with dub it seems to be creating libfoo.a instead of foo.lib, I don't think I changed any settings. Old build based on 2.078 DMDFE seem to have built .lib but LDC based on 2.082 seems to be building .a

Re: Is it's correct to say that ALL types that can grow are place on heap?

2018-09-08 Thread Ali Çehreli via Digitalmars-d-learn
On 09/08/2018 02:19 AM, Suliman wrote: > Is it's correct to say that ALL types that can grow are place on heap > and types that not growing (int, char, pointer) are place on stack? The question is not that simple. :) First, there is also the area used for objects that are static and object that

Re: thread phobos and creating threads

2018-09-08 Thread Marcin via Digitalmars-d-learn
On Saturday, 8 September 2018 at 18:21:07 UTC, drug wrote: On 08.09.2018 20:59, Marcin wrote: void main() { snipped } This? https://run.dlang.io/is/SHyCXA Thanks :)

Re: thread phobos and creating threads

2018-09-08 Thread Marcin via Digitalmars-d-learn
//Ten przyklad po prostu tworzy wątek w którym są trzy obiekty import core.thread; import std.stdio: write, writeln, writef, writefln; class Sinus{ double a; this(){writeln("No Args");} this(double a){writeln("U give 1 argument"); writeln(sin(a));} this(do

Re: thread phobos and creating threads

2018-09-08 Thread drug via Digitalmars-d-learn
On 08.09.2018 20:59, Marcin wrote: void main() { snipped } This? https://run.dlang.io/is/SHyCXA

Re: thread phobos and creating threads

2018-09-08 Thread Marcin via Digitalmars-d-learn
https://run.dlang.io/is/PQkOfF How to make it work? void main() { import core.stdc.math : sin; import core.thread; import std.stdio : write, writeln, writef, writefln; class DerivedThread : Thread { double d; this() { super(&run); }

Re: thread phobos and creating threads

2018-09-08 Thread Marcin via Digitalmars-d-learn
I made somthing else... it works at the moment. https://run.dlang.io/is/KdOeRz But i need somthing like this to work: https://run.dlang.io/is/lGD5YQ

thread phobos and creating threads

2018-09-08 Thread Marcin via Digitalmars-d-learn
Ive got problem with https://run.dlang.io/is/4a4CJp Why it prints 111 forever?

Re: Error: expression `update` of type `void` does not have a boolean value

2018-09-08 Thread Basile B. via Digitalmars-d-learn
On Saturday, 8 September 2018 at 03:12:56 UTC, Josphe Brigmo wrote: auto foo(bool update = false)() { static if(update) { } } and the compiler, after upgrading to 2.082 from 2.080 now says: Error: expression `update` of type `void` does not have a boolean value when update is clearly

Re: Process in parallel and output result to stdout theread-safely

2018-09-08 Thread ag0aep6g via Digitalmars-d-learn
On 09/03/2018 08:13 PM, Dr.No wrote: But it in the middle of output, I got output like this: outjson = {"barCode":"20","ade":"20"}♪◙outjson = {"barCode":"X21","ade":"21"} also there's that extra ♪◙ character. Thos sounds memory violation somewhere. This only happens when using paral

Re: Process in parallel and output result to stdout theread-safely

2018-09-08 Thread Dr.No via Digitalmars-d-learn
Does anyone have some tips to try trace the error with debug or so? I haven't fixed this issue yet... any help is very appreciated

Re: std.process: spawnProcess

2018-09-08 Thread viniarck via Digitalmars-d-learn
On Friday, 7 September 2018 at 14:36:42 UTC, Russel Winder wrote: From what I can see, processes created with std.process: spawnProcess are not terminated when the creating process terminates, i.e. it seems Config.detached is the default for these process. Is there a way of all spawned proces

Re: Error: expression `update` of type `void` does not have a boolean value

2018-09-08 Thread Josphe Brigmo via Digitalmars-d-learn
On Saturday, 8 September 2018 at 07:30:35 UTC, Alex wrote: On Saturday, 8 September 2018 at 06:56:40 UTC, Josphe Brigmo wrote: My project does not use the term update at all in any other context except that one. But I did find: void update(K, V, C, U)(ref V[K] aa, K key, scope C create, sco

Re: std.process: spawnProcess

2018-09-08 Thread Russel Winder via Digitalmars-d-learn
On Sat, 2018-09-08 at 10:24 +, FreeSlave via Digitalmars-d-learn wrote: > On Friday, 7 September 2018 at 14:36:42 UTC, Russel Winder wrote: > > From what I can see, processes created with std.process: > > spawnProcess are not terminated when the creating process > > terminates, i.e. it seems

Re: Returning dynamic array from the function?

2018-09-08 Thread rjframe via Digitalmars-d-learn
On Sat, 08 Sep 2018 10:22:38 +, SuperPrower wrote: > Also, is this me and my bad English, or first comment in code in this > paragraph (linked above, not in the discussion) is supposed to be > something different? Shouldn't it be reference? Static arrays are value types, so the values are cop

Re: std.process: spawnProcess

2018-09-08 Thread FreeSlave via Digitalmars-d-learn
On Friday, 7 September 2018 at 16:44:09 UTC, Russel Winder wrote: I guess this might work on Windows, but I am on Linux and OSX, so I'll have to try another route. On Posix systems you may try using SIGCHLD handler. Google for exact examples.

Re: Returning dynamic array from the function?

2018-09-08 Thread SuperPrower via Digitalmars-d-learn
On Saturday, 8 September 2018 at 10:05:31 UTC, rikki cattermole wrote: onReceive: "The event handler that receives incoming data. Be sure to copy the incoming ubyte[] since it is not guaranteed to be valid after the callback returns." It could be a buffer on the stack, either way, .dup it bef

Re: std.process: spawnProcess

2018-09-08 Thread FreeSlave via Digitalmars-d-learn
On Friday, 7 September 2018 at 14:36:42 UTC, Russel Winder wrote: From what I can see, processes created with std.process: spawnProcess are not terminated when the creating process terminates, i.e. it seems Config.detached is the default for these process. No, detached is not default. By defa

Re: How to understand context type of a delegate?

2018-09-08 Thread Jacob Shtokolov via Digitalmars-d-learn
On Wednesday, 5 September 2018 at 16:53:42 UTC, NX wrote: Is there a way to know what kind of context a delegate has either in compile time or runtime? Also is there any way to check whether a pointer legitimately points to an Object instance? No and no. I was fighting this problem in std.si

Re: Returning dynamic array from the function?

2018-09-08 Thread rikki cattermole via Digitalmars-d-learn
On 08/09/2018 9:46 PM, SuperPrower wrote: On Saturday, 8 September 2018 at 09:36:21 UTC, rikki cattermole wrote: We're going to need to see a minified version of the code to see what you're doing. Sure, here it is: ``` auto getBoards() { string[] boardList; auto url = baseUrl ~ "/a

Re: Returning dynamic array from the function?

2018-09-08 Thread SuperPrower via Digitalmars-d-learn
On Saturday, 8 September 2018 at 09:36:21 UTC, rikki cattermole wrote: We're going to need to see a minified version of the code to see what you're doing. Sure, here it is: ``` auto getBoards() { string[] boardList; auto url = baseUrl ~ "/api/v2/boards"; auto http = HT

Re: Returning dynamic array from the function?

2018-09-08 Thread rikki cattermole via Digitalmars-d-learn
On 08/09/2018 9:34 PM, SuperPrower wrote: I have a function that produces dynamic array of strings. I would like to return this array from this function. I understand that dynamic arrays are of reference type, and thus if I try to return array variable, I will actually return a pointer to the f

Returning dynamic array from the function?

2018-09-08 Thread SuperPrower via Digitalmars-d-learn
I have a function that produces dynamic array of strings. I would like to return this array from this function. I understand that dynamic arrays are of reference type, and thus if I try to return array variable, I will actually return a pointer to the first element of the array on the heap. Pro

Re: std.process: spawnProcess

2018-09-08 Thread Russel Winder via Digitalmars-d-learn
On Sat, 2018-09-08 at 02:38 +, Basile B. via Digitalmars-d-learn wrote: > […] > You can wrap in a Process struct or class and take advantage of > the destructor to do that. Assuming you write standard GC-ed code > the destructor should be called at the end or if you free > manually the reso

Is it's correct to say that ALL types that can grow are place on heap?

2018-09-08 Thread Suliman via Digitalmars-d-learn
Is it's correct to say that ALL types that can grow are place on heap and types that not growing (int, char, pointer) are place on stack? Or there is some exceptions? Is there any tools that can visualize place of data in memory?

Re: Error: expression `update` of type `void` does not have a boolean value

2018-09-08 Thread Alex via Digitalmars-d-learn
On Saturday, 8 September 2018 at 06:56:40 UTC, Josphe Brigmo wrote: My project does not use the term update at all in any other context except that one. But I did find: void update(K, V, C, U)(ref V[K] aa, K key, scope C create, scope U update) Ok... found something here: https://dlang.or

Re: Error: expression `update` of type `void` does not have a boolean value

2018-09-08 Thread Josphe Brigmo via Digitalmars-d-learn
On Saturday, 8 September 2018 at 05:39:39 UTC, Alex wrote: On Saturday, 8 September 2018 at 03:12:56 UTC, Josphe Brigmo wrote: auto foo(bool update = false)() { static if(update) { } } and the compiler, after upgrading to 2.082 from 2.080 now says: Error: expression `update` of type `v