Re: Comparison of Enumerations with base type of String?

2017-08-26 Thread Jonathan M Davis via Digitalmars-d-learn
On Sunday, August 27, 2017 03:47:58 Michael Reiland via Digitalmars-d-learn wrote: > You can randomly assign a string to an enum? Or am I > misunderstanding that last bit of code? No, you can't directly assign a string to an enum of type string. That's part of why they don't pass isInputRange. T

Re: Comparison of Enumerations with base type of String?

2017-08-26 Thread Michael Reiland via Digitalmars-d-learn
You can randomly assign a string to an enum? Or am I misunderstanding that last bit of code? Also it sounds to me like string enums are going to be slower performance wise than integer enums.

Re: ATTN: Andrej Mitrovic: Port Audio

2017-08-26 Thread Johnson via Digitalmars-d-learn
On Sunday, 27 August 2017 at 02:23:32 UTC, Johnson wrote: On Sunday, 27 August 2017 at 02:00:22 UTC, Johnson wrote: You wrote a thread a while back about your callbacks not being called and you had a fix. [...] After going through the code a bit, seems there are some bugs with &stream. Only

Re: ATTN: Andrej Mitrovic: Port Audio

2017-08-26 Thread Johnson via Digitalmars-d-learn
On Sunday, 27 August 2017 at 02:00:22 UTC, Johnson wrote: You wrote a thread a while back about your callbacks not being called and you had a fix. [...] After going through the code a bit, seems there are some bugs with &stream. Only OpenStream seems to take a ** so the other functions are

Re: Comparison of Enumerations with base type of String?

2017-08-26 Thread Jonathan M Davis via Digitalmars-d-learn
On Sunday, August 27, 2017 01:43:14 Michael Reiland via Digitalmars-d-learn wrote: > Hey guys, > > I was running through a tutorial and I noticed that enums can > have a base type of string. Which is interesting, but I'm > wondering about comparisons. > > I'm guessing the comparison boils down to

ATTN: Andrej Mitrovic: Port Audio

2017-08-26 Thread Johnson via Digitalmars-d-learn
You wrote a thread a while back about your callbacks not being called and you had a fix. http://www.digitalmars.com/d/archives/digitalmars/D/learn/Anyone_using_Portaudio_22343.html I'm trying to get portAudio to work on my machine and it seems everything passes yet my callbacks are not being c

Re: How to store data when using parallel processing

2017-08-26 Thread Jonathan M Davis via Digitalmars-d-learn
On Sunday, August 27, 2017 00:26:33 Andrew Chapman via Digitalmars-d-learn wrote: > Hi all, just wanting some advice on parallel processing and > specifically how to deal with access violations. > > I am reading a list of words from a file like this: > > auto fileHandle = File("wordlist.txt", "r")

Comparison of Enumerations with base type of String?

2017-08-26 Thread Michael Reiland via Digitalmars-d-learn
Hey guys, I was running through a tutorial and I noticed that enums can have a base type of string. Which is interesting, but I'm wondering about comparisons. I'm guessing the comparison boils down to a pointer comparison, but I thought I'd confirm.

How to store data when using parallel processing

2017-08-26 Thread Andrew Chapman via Digitalmars-d-learn
Hi all, just wanting some advice on parallel processing and specifically how to deal with access violations. I am reading a list of words from a file like this: auto fileHandle = File("wordlist.txt", "r"); string word; string[] words; string[ulong] hashMap; while ((word = fileHandle.readln())

Re: No CTFE of function

2017-08-26 Thread ag0aep6g via Digitalmars-d-learn
On 08/27/2017 01:53 AM, Cecil Ward wrote: On Saturday, 26 August 2017 at 23:49:30 UTC, Cecil Ward wrote: [...] I think I understand, but I'm not sure. I should have explained properly. I suspect what I should have said was that I was expecting an _optimisation_ and I didn't see it. I thought t

Re: No CTFE of function

2017-08-26 Thread Jonathan M Davis via Digitalmars-d-learn
On Saturday, August 26, 2017 23:53:36 Cecil Ward via Digitalmars-d-learn wrote: > On Saturday, 26 August 2017 at 23:49:30 UTC, Cecil Ward wrote: > > On Saturday, 26 August 2017 at 18:16:07 UTC, ag0aep6g wrote: > >> On Saturday, 26 August 2017 at 16:52:36 UTC, Cecil Ward wrote: > >>> Any ideas as t

Re: No CTFE of function

2017-08-26 Thread Cecil Ward via Digitalmars-d-learn
On Saturday, 26 August 2017 at 23:53:36 UTC, Cecil Ward wrote: On Saturday, 26 August 2017 at 23:49:30 UTC, Cecil Ward wrote: [...] I was expecting this optimisation to 'return literal constant only' because I have seen it before in other cases with GDC. Obviously generating a call that invo

Re: No CTFE of function

2017-08-26 Thread Cecil Ward via Digitalmars-d-learn
On Saturday, 26 August 2017 at 23:49:30 UTC, Cecil Ward wrote: On Saturday, 26 August 2017 at 18:16:07 UTC, ag0aep6g wrote: On Saturday, 26 August 2017 at 16:52:36 UTC, Cecil Ward wrote: Any ideas as to why GDC might just refuse to do CTFE on compile-time-known inputs in a truly pure situation?

Re: No CTFE of function

2017-08-26 Thread Cecil Ward via Digitalmars-d-learn
On Saturday, 26 August 2017 at 18:16:07 UTC, ag0aep6g wrote: On Saturday, 26 August 2017 at 16:52:36 UTC, Cecil Ward wrote: Any ideas as to why GDC might just refuse to do CTFE on compile-time-known inputs in a truly pure situation? That's not how CTFE works. CTFE only kicks in when the *resul

Re: wrapping a C style delegate

2017-08-26 Thread Ali Çehreli via Digitalmars-d-learn
On 08/25/2017 05:49 PM, Nicholas Wilson wrote: > I was thinking of something along those lines: but what about the > lifetime of the passed delegate (the address of a local variable)? How > can I ensure that it won't segfault when callback goes out of scope? > I could new it with the GC but > a)

Getting error in dmd testsuite

2017-08-26 Thread Thomas Mader via Digitalmars-d-learn
Hello, I am building ldc on Nix (https://nixos.org/nix/) but keep getting an error while running the cppa.d test from the dmd testsuite (https://github.com/ldc-developers/dmd-testsuite). 1588: ... runnable/cppa.d -L-lstdc++ (-g) -O 1588: Test failed. The logged output: 1588:

Re: Retrieve the data of all the threads together once all threads are completed in a task pool

2017-08-26 Thread vino via Digitalmars-d-learn
On Saturday, 26 August 2017 at 17:38:37 UTC, Vino.B wrote: Hi, Can some one provide me an example of how to wait for all the threads to be completed in a taskPool and then retrieve the data of all the threads together instead of getting the data of each threads(after successfully executed).

Re: How do I send a message to a struct member function?

2017-08-26 Thread Enjoys Math via Digitalmars-d-learn
On Saturday, 26 August 2017 at 10:05:31 UTC, drug wrote: 26.08.2017 09:49, Enjoys Math пишет: I have a series of structs each of which needs to spawn a worker thread on initialization. There seems to be no way to send a message back to the struct for instance to cause a member function call

Re: No CTFE of function

2017-08-26 Thread ag0aep6g via Digitalmars-d-learn
On Saturday, 26 August 2017 at 16:52:36 UTC, Cecil Ward wrote: Any ideas as to why GDC might just refuse to do CTFE on compile-time-known inputs in a truly pure situation? That's not how CTFE works. CTFE only kicks in when the *result* is required at compile time. For example, when you assign

Retrieve the data of all the threads together once all threads are completed in a task pool

2017-08-26 Thread Vino.B via Digitalmars-d-learn
Hi, Can some one provide me an example of how to wait for all the threads to be completed in a taskPool and then retrieve the data of all the threads together instead of getting the data of each threads(after successfully executed). For example, the below test program outputs only one strin

No CTFE of function

2017-08-26 Thread Cecil Ward via Digitalmars-d-learn
I have a pure function that has constant inputs, known at compile-time, contains no funny stuff internally - looked at the generated code, and no RTL calls at all. But in a test call with constant literal values (arrays initialised to literal) passed to the pure routine GDC refuses to CTFE the

Re: (SIMD) Optimized multi-byte chunk scanning

2017-08-26 Thread Cecil Ward via Digitalmars-d-learn
On Friday, 25 August 2017 at 18:52:57 UTC, Nordlöw wrote: On Friday, 25 August 2017 at 09:40:28 UTC, Igor wrote: As for a nice reference of intel intrinsics: https://software.intel.com/sites/landingpage/IntrinsicsGuide/ Wow, what a fabulous UX! The pcmpestri instruction is probably what you

Re: Building (and including libraries) without dub

2017-08-26 Thread Jonathan Marler via Digitalmars-d-learn
On Saturday, 26 August 2017 at 12:45:31 UTC, Adam D. Ruppe wrote: On Saturday, 26 August 2017 at 09:03:03 UTC, Hasen Judy wrote: Building simple programs without dub is easy, just pass a list of .d source files to `dmd` or `ldc2`. What if I want to include a 3rd party library? It is also eas

Re: Building (and including libraries) without dub

2017-08-26 Thread Adam D. Ruppe via Digitalmars-d-learn
On Saturday, 26 August 2017 at 09:03:03 UTC, Hasen Judy wrote: Building simple programs without dub is easy, just pass a list of .d source files to `dmd` or `ldc2`. What if I want to include a 3rd party library? It is also easy, just pass the list of its d source files to the compiler as wel

Re: Building (and including libraries) without dub

2017-08-26 Thread Mike Wey via Digitalmars-d-learn
On 26-08-17 12:02, drug wrote: 26.08.2017 12:03, Hasen Judy пишет: Building simple programs without dub is easy, just pass a list of .d source files to `dmd` or `ldc2`. What if I want to include a 3rd party library? Surely before dub existed, people were incorporating other libraries in their

Re: 2 Dimensional Array Sorting

2017-08-26 Thread Vino.B via Digitalmars-d-learn
On Saturday, 26 August 2017 at 10:45:13 UTC, Vino.B wrote: On Saturday, 26 August 2017 at 10:07:53 UTC, user1234 wrote: [...] Hi, Now there is no duplicate , but the sequence is still not correct [...] Hi, If I execute the script several time's i still get the duplicate entries. F

Re: 2 Dimensional Array Sorting

2017-08-26 Thread Vino.B via Digitalmars-d-learn
On Saturday, 26 August 2017 at 10:07:53 UTC, user1234 wrote: On Saturday, 26 August 2017 at 09:53:44 UTC, Vino.B wrote: On Saturday, 26 August 2017 at 06:12:57 UTC, user1234 wrote: [...] Hi, I tired you logic, but doesn't seem to be working, as every time i execute the order of the file li

Re: 2 Dimensional Array Sorting

2017-08-26 Thread user1234 via Digitalmars-d-learn
On Saturday, 26 August 2017 at 09:53:44 UTC, Vino.B wrote: On Saturday, 26 August 2017 at 06:12:57 UTC, user1234 wrote: [...] Hi, I tired you logic, but doesn't seem to be working, as every time i execute the order of the file list is different as in the below program i have used the sort

Re: Building (and including libraries) without dub

2017-08-26 Thread drug via Digitalmars-d-learn
26.08.2017 13:05, Hasen Judy пишет: On Saturday, 26 August 2017 at 10:02:03 UTC, drug wrote: It's like C++. If you use Linux then: ``` dmd -L/path/to/lib -llibrarynamewithoutlibprefix ``` or example ``` dmd myapp.d -L../otherproject/lib -lcool ``` line above compiles `myapp.d` file and links

Re: How do I send a message to a struct member function?

2017-08-26 Thread drug via Digitalmars-d-learn
26.08.2017 09:49, Enjoys Math пишет: I have a series of structs each of which needs to spawn a worker thread on initialization. There seems to be no way to send a message back to the struct for instance to cause a member function call on /that/ structs data. Please advise me. If it is appr

Re: Building (and including libraries) without dub

2017-08-26 Thread Hasen Judy via Digitalmars-d-learn
On Saturday, 26 August 2017 at 10:02:03 UTC, drug wrote: It's like C++. If you use Linux then: ``` dmd -L/path/to/lib -llibrarynamewithoutlibprefix ``` or example ``` dmd myapp.d -L../otherproject/lib -lcool ``` line above compiles `myapp.d` file and links it with library `libcool` that is pl

Re: Building (and including libraries) without dub

2017-08-26 Thread drug via Digitalmars-d-learn
26.08.2017 12:03, Hasen Judy пишет: Building simple programs without dub is easy, just pass a list of .d source files to `dmd` or `ldc2`. What if I want to include a 3rd party library? Surely before dub existed, people were incorporating other libraries in their projects. I want to learn how

Re: 2 Dimensional Array Sorting

2017-08-26 Thread Vino.B via Digitalmars-d-learn
On Saturday, 26 August 2017 at 06:12:57 UTC, user1234 wrote: On Saturday, 26 August 2017 at 06:11:37 UTC, user1234 wrote: On Saturday, 26 August 2017 at 06:01:15 UTC, Vino.B wrote: Hi, Can someone provide me a example of sorting 2 Dimensional Array containing Filename and Size, and should be

Building (and including libraries) without dub

2017-08-26 Thread Hasen Judy via Digitalmars-d-learn
Building simple programs without dub is easy, just pass a list of .d source files to `dmd` or `ldc2`. What if I want to include a 3rd party library? Surely before dub existed, people were incorporating other libraries in their projects. I want to learn how this works from first principles. I

Re: spawnProcess: Exit parent process without terminating child process

2017-08-26 Thread FreeSlave via Digitalmars-d-learn
On Friday, 25 August 2017 at 19:55:09 UTC, timvol wrote: Hi guys, I want execute a process. I know, I can execute a process using "spawnProcess" or "executeShell". But I want exit the parent. My code for testing purposes is the following: int main(string[] asArgs_p) { if ( (asArgs_p.leng

Re: spawnProcess: Exit parent process without terminating child process

2017-08-26 Thread FreeSlave via Digitalmars-d-learn
On Friday, 25 August 2017 at 19:55:09 UTC, timvol wrote: Hi guys, I want execute a process. I know, I can execute a process using "spawnProcess" or "executeShell". But I want exit the parent. My code for testing purposes is the following: int main(string[] asArgs_p) { if ( (asArgs_p.leng

Re: pipeProcess not returning immediately

2017-08-26 Thread FoxyBrown via Digitalmars-d-learn
On Saturday, 26 August 2017 at 06:24:26 UTC, user1234 wrote: On Saturday, 26 August 2017 at 01:13:35 UTC, Johnson Jones wrote: I am running ffplay.exe and my application does not return immediately from pipeProcess. I have to close ffplay for my program to continue execution. No process is as

Re: testing for deprecation

2017-08-26 Thread user1234 via Digitalmars-d-learn
On Friday, 25 August 2017 at 20:35:52 UTC, jmh530 wrote: On Thursday, 1 September 2016 at 11:13:42 UTC, rikki cattermole wrote: That is a first that somebody wanted it. Bug report please! I just ran across this with deprecated { void foo(); } void main() { pragma(msg, __traits(getAtt