Re: New programming paradigm

2018-06-03 Thread DigitalDesigns via Digitalmars-d-learn
On Sunday, 3 June 2018 at 16:36:52 UTC, Simen Kjærås wrote: On Sunday, 3 June 2018 at 14:57:37 UTC, DigitalDesigns wrote: On Sunday, 3 June 2018 at 09:52:01 UTC, Malte wrote: You might want to have a look at https://wiki.dlang.org/Dynamic_typing This sounds very similar to what you are doing.

Re: Confusion/trying to understand CTFE keywords

2018-06-03 Thread Jonathan M Davis via Digitalmars-d-learn
On Sunday, June 03, 2018 21:32:06 gdelazzari via Digitalmars-d-learn wrote: > Hello everyone, I'm new here on the forum but I've been exploring > D for quite a while. I'm not an expert programmer by any means, > so this one may be a really silly question and, in that case, > please forgive me. > >

Re: Confusion/trying to understand CTFE keywords

2018-06-03 Thread Dave Jones via Digitalmars-d-learn
On Sunday, 3 June 2018 at 21:32:06 UTC, gdelazzari wrote: Note that this is not an attack to the language or anything (I actually really love it), I'm just trying to understand the reasoning behind this choice. Because they have a thing about not adding new keywords, apparently it's more

Re: Confusion/trying to understand CTFE keywords

2018-06-03 Thread Computermatronic via Digitalmars-d-learn
On Sunday, 3 June 2018 at 21:32:06 UTC, gdelazzari wrote: I'm trying to understand why keywords such as "static" or "enum" are used to denote compile time "things". What I mean is that those keywords are also used for other purposes, so I find it a bit confusing. Couldn't a keyword like "ctfe"

Confusion/trying to understand CTFE keywords

2018-06-03 Thread gdelazzari via Digitalmars-d-learn
Hello everyone, I'm new here on the forum but I've been exploring D for quite a while. I'm not an expert programmer by any means, so this one may be a really silly question and, in that case, please forgive me. With the premise that I've still not looked a lot into "complex" compile time

Re: how to define infix function

2018-06-03 Thread Meta via Digitalmars-d-learn
On Saturday, 2 June 2018 at 23:17:48 UTC, Simen Kjærås wrote: On Saturday, 2 June 2018 at 22:09:49 UTC, Neia Neutuladh wrote: On Saturday, 2 June 2018 at 21:44:39 UTC, greatsam4sure wrote: Sorry for the typo is it possible to define infix function in D 3.min(5)// 3: where min is a function,

Re: New programming paradigm

2018-06-03 Thread Simen Kjærås via Digitalmars-d-learn
On Sunday, 3 June 2018 at 14:57:37 UTC, DigitalDesigns wrote: On Sunday, 3 June 2018 at 09:52:01 UTC, Malte wrote: You might want to have a look at https://wiki.dlang.org/Dynamic_typing This sounds very similar to what you are doing. I never really looked into it, because I prefer to know

Re: Line endings when redirecting output to file on windows.

2018-06-03 Thread Bastiaan Veelo via Digitalmars-d-learn
On Sunday, 3 June 2018 at 15:42:48 UTC, rikki cattermole wrote: On 04/06/2018 3:24 AM, Bastiaan Veelo wrote: I need some help understanding where extra '\r' come from when output is redirected to file on Windows. First, this works correctly:  rdmd --eval="(\"hello\" ~

Re: pipeProcess failing

2018-06-03 Thread Paul Backus via Digitalmars-d-learn
On Sunday, 3 June 2018 at 15:07:07 UTC, DigitalDesigns wrote: I'm calling pipe process using pipeProcess([AliasSeq!args], Redirect.stdout | Redirect.stdin); where args is a tuple. Everything works when I pass each argument individually. If I combine any args using a space it fails or if I

Re: New programming paradigm

2018-06-03 Thread Paul Backus via Digitalmars-d-learn
On Monday, 4 September 2017 at 03:26:23 UTC, EntangledQuanta wrote: Take a variant type. It contains the "type" and the data. To simplify, we will treat look at it like (pseudo-code, use your brain) enum Type { int, float } foo(void* Data, Type type); The normal way to deal with this is a

Re: Line endings when redirecting output to file on windows.

2018-06-03 Thread rikki cattermole via Digitalmars-d-learn
On 04/06/2018 3:24 AM, Bastiaan Veelo wrote: I need some help understanding where extra '\r' come from when output is redirected to file on Windows. First, this works correctly:  rdmd --eval="(\"hello\" ~ newline).toFile(\"out.txt\");" As expected, out.txt contains "hello\r\n". I would

Line endings when redirecting output to file on windows.

2018-06-03 Thread Bastiaan Veelo via Digitalmars-d-learn
I need some help understanding where extra '\r' come from when output is redirected to file on Windows. First, this works correctly: rdmd --eval="(\"hello\" ~ newline).toFile(\"out.txt\");" As expected, out.txt contains "hello\r\n". I would expect the following to do the same, but it doesn't:

pipeProcess failing

2018-06-03 Thread DigitalDesigns via Digitalmars-d-learn
I'm calling pipe process using pipeProcess([AliasSeq!args], Redirect.stdout | Redirect.stdin); where args is a tuple. Everything works when I pass each argument individually. If I combine any args using a space it fails or if I pass an argument with "". So I guess something like this

Re: New programming paradigm

2018-06-03 Thread DigitalDesigns via Digitalmars-d-learn
On Sunday, 3 June 2018 at 09:52:01 UTC, Malte wrote: On Saturday, 2 June 2018 at 23:12:46 UTC, DigitalDesigns wrote: On Thursday, 7 September 2017 at 22:53:31 UTC, Biotronic wrote: [...] I use something similar where I use structs behaving like enums. Each field in the struct is an "enum

Re: how to define infix function

2018-06-03 Thread greatsam4sure via Digitalmars-d-learn
On Saturday, 2 June 2018 at 22:09:49 UTC, Neia Neutuladh wrote: On Saturday, 2 June 2018 at 21:44:39 UTC, greatsam4sure wrote: [...] This is a horrible abuse of D's operator overloading discovered by FeepingCreature in the distant past. You have to delimit your custom infix operator with

Re: New programming paradigm

2018-06-03 Thread Malte via Digitalmars-d-learn
On Saturday, 2 June 2018 at 23:12:46 UTC, DigitalDesigns wrote: On Thursday, 7 September 2017 at 22:53:31 UTC, Biotronic wrote: [...] I use something similar where I use structs behaving like enums. Each field in the struct is an "enum value" which an attribute, this is because I have not

Re: Convert a huge SQL file to CSV

2018-06-03 Thread biocyberman via Digitalmars-d-learn
On Friday, 1 June 2018 at 10:15:11 UTC, Martin Tschierschke wrote: On Friday, 1 June 2018 at 09:49:23 UTC, biocyberman wrote: I need to convert a compressed 17GB SQL dump to CSV. A workable solution is to create a temporary mysql database, import the dump, query by python, and export. But i