Re: What the hell is wrong with D?

2017-09-19 Thread nkm1 via Digitalmars-d-learn
On Wednesday, 20 September 2017 at 02:16:16 UTC, EntangledQuanta wrote: Your an idiot, I know about how operator precedence works far more than you do. Wanna bet? how much? Your house? your wife? Your life? It's about doing things correctly, you seem to fail to understand, not your fault,

Re: What the hell is wrong with D?

2017-09-19 Thread EntangledQuanta via Digitalmars-d-learn
On Wednesday, 20 September 2017 at 02:57:21 UTC, jmh530 wrote: On Wednesday, 20 September 2017 at 02:36:50 UTC, Jonathan M Davis wrote: Please try to be civil. It's fine if you're unhappy about some aspect of how D works and want to discuss it, but we do not condone personal attacks here.

Re: How to list all process directories under /proc/

2017-09-19 Thread Ky-Anh Huynh via Digitalmars-d-learn
On Tuesday, 19 September 2017 at 18:32:06 UTC, Matt Jones wrote: On Tuesday, 19 September 2017 at 13:32:29 UTC, Ky-Anh Huynh wrote: Btw, is that a bit weird that range is not supported in glob pattern :) Is there a design reason for this? That is strange. But then again, every glob

Re: What the hell is wrong with D?

2017-09-19 Thread EntangledQuanta via Digitalmars-d-learn
On Wednesday, 20 September 2017 at 02:36:50 UTC, Jonathan M Davis wrote: On Wednesday, September 20, 2017 02:16:16 EntangledQuanta via Digitalmars-d- learn wrote: On Tuesday, 19 September 2017 at 21:17:53 UTC, nkm1 wrote: > On Tuesday, 19 September 2017 at 17:40:20 UTC, > EntangledQuanta > >

Re: What the hell is wrong with D?

2017-09-19 Thread jmh530 via Digitalmars-d-learn
On Wednesday, 20 September 2017 at 02:36:50 UTC, Jonathan M Davis wrote: Please try to be civil. It's fine if you're unhappy about some aspect of how D works and want to discuss it, but we do not condone personal attacks here. - Jonathan M Davis He seemed to be threatening the guy's life

Re: What the hell is wrong with D?

2017-09-19 Thread B4s1L3 via Digitalmars-d-learn
On Wednesday, 20 September 2017 at 02:16:16 UTC, EntangledQuanta wrote: Your an idiot, I know about how operator precedence works far more than you do. Wanna bet? how much? Your house? your wife? Your life? It's about doing things correctly, you seem to fail to understand, not your fault,

Re: What the hell is wrong with D?

2017-09-19 Thread Jonathan M Davis via Digitalmars-d-learn
On Wednesday, September 20, 2017 02:16:16 EntangledQuanta via Digitalmars-d- learn wrote: > On Tuesday, 19 September 2017 at 21:17:53 UTC, nkm1 wrote: > > On Tuesday, 19 September 2017 at 17:40:20 UTC, EntangledQuanta > > > > wrote: > >> Yeah, that is really logical! No wonder D sucks and has so >

Re: What the hell is wrong with D?

2017-09-19 Thread EntangledQuanta via Digitalmars-d-learn
On Tuesday, 19 September 2017 at 22:11:44 UTC, Jesse Phillips wrote: On Tuesday, 19 September 2017 at 19:16:05 UTC, EntangledQuanta wrote: The D community preaches all this safety shit but when it comes down to it they don't seem to really care(look at the other responses like like "Hey, C

Re: What the hell is wrong with D?

2017-09-19 Thread EntangledQuanta via Digitalmars-d-learn
On Tuesday, 19 September 2017 at 21:17:53 UTC, nkm1 wrote: On Tuesday, 19 September 2017 at 17:40:20 UTC, EntangledQuanta wrote: Yeah, that is really logical! No wonder D sucks and has so many bugs! Always wants me to be explicit about the stuff it won't figure out but it implicitly does stuff

Re: What the hell is wrong with D?

2017-09-19 Thread rikki cattermole via Digitalmars-d-learn
On 19/09/2017 9:22 PM, Neia Neutuladh wrote: On Tuesday, 19 September 2017 at 17:40:20 UTC, EntangledQuanta wrote: writeln(x + ((_win[0] == '@') ? w/2 : 0)); writeln(x + (_win[0] == '@') ? w/2 : 0); The first returns x + w/2 and the second returns w/2! Yeah, it sucks to have bugs

Re: floating point value rounded to 6digits

2017-09-19 Thread Steven Schveighoffer via Digitalmars-d-learn
On 9/19/17 8:04 PM, Jonathan M Davis wrote: On Tuesday, September 19, 2017 19:35:15 Steven Schveighoffer via Digitalmars-d-learn wrote: On 9/19/17 7:28 PM, Ivan Kazmenko wrote: On Tuesday, 19 September 2017 at 22:44:06 UTC, greatsam4sure wrote: On Tuesday, 19 September 2017 at 21:52:57 UTC,

Re: floating point value rounded to 6digits

2017-09-19 Thread Jonathan M Davis via Digitalmars-d-learn
On Tuesday, September 19, 2017 19:35:15 Steven Schveighoffer via Digitalmars-d-learn wrote: > On 9/19/17 7:28 PM, Ivan Kazmenko wrote: > > On Tuesday, 19 September 2017 at 22:44:06 UTC, greatsam4sure wrote: > >> On Tuesday, 19 September 2017 at 21:52:57 UTC, Ivan Kazmenko wrote: > >>> On Tuesday,

Re: floating point value rounded to 6digits

2017-09-19 Thread Steven Schveighoffer via Digitalmars-d-learn
On 9/19/17 7:28 PM, Ivan Kazmenko wrote: On Tuesday, 19 September 2017 at 22:44:06 UTC, greatsam4sure wrote: On Tuesday, 19 September 2017 at 21:52:57 UTC, Ivan Kazmenko wrote: On Tuesday, 19 September 2017 at 20:47:02 UTC, greatsam4sure wrote: double  value = 20.89766554373733;

Re: floating point value rounded to 6digits

2017-09-19 Thread Ivan Kazmenko via Digitalmars-d-learn
On Tuesday, 19 September 2017 at 22:44:06 UTC, greatsam4sure wrote: On Tuesday, 19 September 2017 at 21:52:57 UTC, Ivan Kazmenko wrote: On Tuesday, 19 September 2017 at 20:47:02 UTC, greatsam4sure wrote: double value = 20.89766554373733; writeln(value); //Output =20.8977 How do I output the

Re: floating point value rounded to 6digits

2017-09-19 Thread Steven Schveighoffer via Digitalmars-d-learn
On 9/19/17 6:44 PM, greatsam4sure wrote: I don't  want to use write,writefln or format. I just want to change the default It's not a bad idea for an enhancement request -- provide default format specifiers for a given type. Currently, there isn't a mechanism for that. -Steve

Re: opEquals code generation

2017-09-19 Thread Steven Schveighoffer via Digitalmars-d-learn
On 9/19/17 4:28 PM, Neia Neutuladh wrote: Could be a bit simpler than that, depending on your needs: bool opEquals(Object other) const nothrow @nogc {     auto f = cast(typeof(this)) other;     if (f is null) return false;     return this.tupleof == other.tupleof; } That doesn't compare

Re: formattedRead can't work with tab delimiter input

2017-09-19 Thread Ky-Anh Huynh via Digitalmars-d-learn
On Tuesday, 19 September 2017 at 20:04:36 UTC, kdevel wrote: On Tuesday, 19 September 2017 at 13:28:22 UTC, Ky-Anh Huynh wrote: Hi, I want to read two fields from STDIN string key; double value; line_st.formattedRead!"%s %f"(key, value); Well it's so different from C. I would

Re: floating point value rounded to 6digits

2017-09-19 Thread greatsam4sure via Digitalmars-d-learn
On Tuesday, 19 September 2017 at 21:52:57 UTC, Ivan Kazmenko wrote: On Tuesday, 19 September 2017 at 20:47:02 UTC, greatsam4sure wrote: double value = 20.89766554373733; writeln(value); //Output =20.8977 How do I output the whole value without using writfln,write or format. How do I change

Re: What the hell is wrong with D?

2017-09-19 Thread Jesse Phillips via Digitalmars-d-learn
On Tuesday, 19 September 2017 at 19:16:05 UTC, EntangledQuanta wrote: The D community preaches all this safety shit but when it comes down to it they don't seem to really care(look at the other responses like like "Hey, C does it" or "Hey, look up the operator precedence"... as if those

Re: floating point value rounded to 6digits

2017-09-19 Thread Ivan Kazmenko via Digitalmars-d-learn
On Tuesday, 19 September 2017 at 20:47:02 UTC, greatsam4sure wrote: double value = 20.89766554373733; writeln(value); //Output =20.8977 How do I output the whole value without using writfln,write or format. How do I change this default The default when printing floating-point numbers is to

Re: What the hell is wrong with D?

2017-09-19 Thread nkm1 via Digitalmars-d-learn
On Tuesday, 19 September 2017 at 17:40:20 UTC, EntangledQuanta wrote: Yeah, that is really logical! No wonder D sucks and has so many bugs! Always wants me to be explicit about the stuff it won't figure out but it implicitly does stuff that makes no sense. The whole point of the parenthesis is

Re: What the hell is wrong with D?

2017-09-19 Thread jmh530 via Digitalmars-d-learn
On Tuesday, 19 September 2017 at 20:00:40 UTC, Brad Anderson wrote: If you want to help, I suggest trying to come up with a DIP that addresses it while being conscious of how to avoid breaking an enormous amount of code. I suspect it's a hard and maybe impossible problem but if you are up

floating point value rounded to 6digits

2017-09-19 Thread greatsam4sure via Digitalmars-d-learn
double value = 20.89766554373733; writeln(value); //Output =20.8977 How do I output the whole value without using writfln,write or format. How do I change this default

Re: opEquals code generation

2017-09-19 Thread Neia Neutuladh via Digitalmars-d-learn
On Tuesday, 19 September 2017 at 13:18:04 UTC, drug wrote: 19.09.2017 15:38, Steven Schveighoffer пишет: On 9/19/17 8:01 AM, drug wrote: I iterate over struct members and check against equality depending on member type. is there more simple/cleaner/better way to achieve this functionality?

Re: What the hell is wrong with D?

2017-09-19 Thread Neia Neutuladh via Digitalmars-d-learn
On Tuesday, 19 September 2017 at 17:40:20 UTC, EntangledQuanta wrote: writeln(x + ((_win[0] == '@') ? w/2 : 0)); writeln(x + (_win[0] == '@') ? w/2 : 0); The first returns x + w/2 and the second returns w/2! Yeah, it sucks to have bugs like this crop up. I have enough

Re: How to compile for Win64 with Visual D? Optlink error?

2017-09-19 Thread Rainer Schuetze via Digitalmars-d-learn
On 19.09.2017 13:47, Timothy Foster wrote: I'm trying to compile my project as a Win64 application but this is happening: Building C:\Users\me\test\test.exe... OPTLINK (R) for Win32  Release 8.00.17 Copyright (C) Digital Mars 1989-2013  All rights reserved.

Re: What the hell is wrong with D?

2017-09-19 Thread Brad Anderson via Digitalmars-d-learn
On Tuesday, 19 September 2017 at 19:16:05 UTC, EntangledQuanta wrote: [snip] I'm just glad there is at least one sane person that decided to chime in... was quite surprised actually. I find it quite pathetic when someone tries to justify a wrong by pointing to other wrongs. It takes away all

Re: formattedRead can't work with tab delimiter input

2017-09-19 Thread kdevel via Digitalmars-d-learn
On Tuesday, 19 September 2017 at 13:28:22 UTC, Ky-Anh Huynh wrote: Hi, I want to read two fields from STDIN string key; double value; line_st.formattedRead!"%s %f"(key, value); Well it's so different from C. I would use this: --- auto t = line_st.split.join (' ');

Re: What the hell is wrong with D?

2017-09-19 Thread Steven Schveighoffer via Digitalmars-d-learn
On 9/19/17 1:40 PM, EntangledQuanta wrote: The first returns x + w/2 and the second returns w/2! Did you mean (x + w) / 2 or x + (w / 2)? Stop being ambiguous! -Steve

Re: What the hell is wrong with D?

2017-09-19 Thread jmh530 via Digitalmars-d-learn
On Tuesday, 19 September 2017 at 19:16:05 UTC, EntangledQuanta wrote: ()?: is not ambiguous! The D community preaches all this safety shit but when it comes down to it they don't seem to really care(look at the other responses like like "Hey, C does it" or "Hey, look up the operator

Re: What the hell is wrong with D?

2017-09-19 Thread EntangledQuanta via Digitalmars-d-learn
On Tuesday, 19 September 2017 at 18:51:51 UTC, Jesse Phillips wrote: On Tuesday, 19 September 2017 at 17:40:20 UTC, EntangledQuanta wrote: I assume someone is going to tell me that the compiler treats it as writeln((x + (_win[0] == '@')) ? w/2 : 0); Yeah, that is really logical! Yeah, I've

Re: What the hell is wrong with D?

2017-09-19 Thread Jesse Phillips via Digitalmars-d-learn
On Tuesday, 19 September 2017 at 17:40:20 UTC, EntangledQuanta wrote: I assume someone is going to tell me that the compiler treats it as writeln((x + (_win[0] == '@')) ? w/2 : 0); Yeah, that is really logical! Yeah, I've been bitten by that in languages like C#. I wish D didn't follow in

Re: What the hell is wrong with D?

2017-09-19 Thread Ali Çehreli via Digitalmars-d-learn
On 09/19/2017 11:34 AM, Brad Anderson wrote: > On Tuesday, 19 September 2017 at 18:17:47 UTC, jmh530 wrote: >> Pretty sure it would be exactly the same thing in C... > > It is (and Java and C# and pretty much every other C style language > though the nicer implicit conversion rules means it gets

Re: What the hell is wrong with D?

2017-09-19 Thread Brad Anderson via Digitalmars-d-learn
On Tuesday, 19 September 2017 at 18:17:47 UTC, jmh530 wrote: On Tuesday, 19 September 2017 at 17:40:20 UTC, EntangledQuanta wrote: Thanks for wasting some of my life... Just curious about who will justify the behavior and what excuses they will give. Pretty sure it would be exactly the same

Re: How to list all process directories under /proc/

2017-09-19 Thread Matt Jones via Digitalmars-d-learn
On Tuesday, 19 September 2017 at 13:32:29 UTC, Ky-Anh Huynh wrote: Btw, is that a bit weird that range is not supported in glob pattern :) Is there a design reason for this? That is strange. But then again, every glob library I've seen works a little bit differently.

Re: What the hell is wrong with D?

2017-09-19 Thread jmh530 via Digitalmars-d-learn
On Tuesday, 19 September 2017 at 17:40:20 UTC, EntangledQuanta wrote: Thanks for wasting some of my life... Just curious about who will justify the behavior and what excuses they will give. Pretty sure it would be exactly the same thing in C...

Re: What the hell is wrong with D?

2017-09-19 Thread Eugene Wissner via Digitalmars-d-learn
On Tuesday, 19 September 2017 at 17:40:20 UTC, EntangledQuanta wrote: writeln(x + ((_win[0] == '@') ? w/2 : 0)); writeln(x + (_win[0] == '@') ? w/2 : 0); The first returns x + w/2 and the second returns w/2! WTF!!! This stupid bug has caused me considerable waste of time.

What the hell is wrong with D?

2017-09-19 Thread EntangledQuanta via Digitalmars-d-learn
writeln(x + ((_win[0] == '@') ? w/2 : 0)); writeln(x + (_win[0] == '@') ? w/2 : 0); The first returns x + w/2 and the second returns w/2! WTF!!! This stupid bug has caused me considerable waste of time. Thanks Walter! I know you care so much about my time! I assume someone

Re: Assertion Error

2017-09-19 Thread Vino.B via Digitalmars-d-learn
On Wednesday, 13 September 2017 at 15:27:30 UTC, Moritz Maxeiner wrote: On Wednesday, 13 September 2017 at 15:12:57 UTC, Vino.B wrote: On Wednesday, 13 September 2017 at 11:03:38 UTC, Moritz Maxeiner wrote: On Wednesday, 13 September 2017 at 07:39:46 UTC, Vino.B wrote: [...] [...] ---

Re: How to list all process directories under /proc/

2017-09-19 Thread Ky-Anh Huynh via Digitalmars-d-learn
On Tuesday, 19 September 2017 at 06:35:18 UTC, Matt Jones wrote: On Sunday, 17 September 2017 at 08:37:33 UTC, Ky-Anh Huynh wrote: [...] The problem with matching "[0123456789]*" is that it will match files like "1blah" and "8stuff". It looks like glob patterns are not robust enough to

formattedRead can't work with tab delimiter input

2017-09-19 Thread Ky-Anh Huynh via Digitalmars-d-learn
Hi, I want to read two fields from STDIN string key; double value; line_st.formattedRead!"%s %f"(key, value); However, if the input line contains \t and it doesn't contain any space, the code doesn't work as expected. If there is a space, it works well a[space]1 #

Re: opEquals code generation

2017-09-19 Thread drug via Digitalmars-d-learn
19.09.2017 15:38, Steven Schveighoffer пишет: On 9/19/17 8:01 AM, drug wrote: I iterate over struct members and check against equality depending on member type. is there more simple/cleaner/better way to achieve this functionality? Especially without string mixins? Why not just use tupleof

Re: Basic LDC Linux Install Question

2017-09-19 Thread jmh530 via Digitalmars-d-learn
On Tuesday, 19 September 2017 at 12:37:12 UTC, Daniel Kozak wrote: Yes you need to add ldc2 to your PATH. So if your ldc2 binary is in /user/something/something/folder_where_is_ldc2/ldc2 you havto add /user/something/something/folder_where_is_ldc2 to your PATH. You can test this by pasting

Re: opEquals code generation

2017-09-19 Thread Steven Schveighoffer via Digitalmars-d-learn
On 9/19/17 8:01 AM, drug wrote: I iterate over struct members and check against equality depending on member type. is there more simple/cleaner/better way to achieve this functionality? Especially without string mixins? Why not just use tupleof directly instead of having to find the member

Re: Basic LDC Linux Install Question

2017-09-19 Thread Daniel Kozak via Digitalmars-d-learn
Yes you need to add ldc2 to your PATH. So if your ldc2 binary is in /user/something/something/folder_where_is_ldc2/ldc2 you havto add /user/something/something/folder_where_is_ldc2 to your PATH. You can test this by pasting this to terminal: export

Basic LDC Linux Install Question

2017-09-19 Thread jmh530 via Digitalmars-d-learn
I'm more of a Windows user than a Linux user. I have the latest DMD on my Linux install (linux mint 17.3), but I wanted to test LDC. I get a message that ldc2 is not found when I type ldc2 --version or sudo ldc2 --version (I'm not on root and the existing user does not have root privileges,

Re: opEquals code generation

2017-09-19 Thread drug via Digitalmars-d-learn
19.09.2017 15:01, drug пишет: I iterate over struct members and check against equality depending on member type. is there more simple/cleaner/better way to achieve this functionality? Especially without string mixins? oops, https://run.dlang.io/is/PbZE5i

Re: How to compile for Win64 with Visual D? Optlink error?

2017-09-19 Thread Daniel Kozak via Digitalmars-d-learn
this should be ok, can you post error when using with m64 On Tue, Sep 19, 2017 at 1:47 PM, Timothy Foster via Digitalmars-d-learn < digitalmars-d-learn@puremagic.com> wrote: > I'm trying to compile my project as a Win64 application but this is > happening: > > Building

Re: How to compile for Win64 with Visual D? Optlink error?

2017-09-19 Thread Nicholas Wilson via Digitalmars-d-learn
On Tuesday, 19 September 2017 at 11:47:00 UTC, Timothy Foster wrote: I'm trying to compile my project as a Win64 application but this is happening: Building C:\Users\me\test\test.exe... OPTLINK (R) for Win32 Release 8.00.17 Copyright (C) Digital Mars 1989-2013 All rights reserved.

opEquals code generation

2017-09-19 Thread drug via Digitalmars-d-learn
I iterate over struct members and check against equality depending on member type. is there more simple/cleaner/better way to achieve this functionality? Especially without string mixins?

How to compile for Win64 with Visual D? Optlink error?

2017-09-19 Thread Timothy Foster via Digitalmars-d-learn
I'm trying to compile my project as a Win64 application but this is happening: Building C:\Users\me\test\test.exe... OPTLINK (R) for Win32 Release 8.00.17 Copyright (C) Digital Mars 1989-2013 All rights reserved. http://www.digitalmars.com/ctg/optlink.html OPTLINK : Warning 183: Extension not

Re: How to list all process directories under /proc/

2017-09-19 Thread Matt Jones via Digitalmars-d-learn
On Sunday, 17 September 2017 at 08:37:33 UTC, Ky-Anh Huynh wrote: The official documentation here https://dlang.org/phobos/std_path.html#.globMatch refers to the wiki page https://en.wikipedia.org/wiki/Glob_%28programming%29 . However I think the popular glob rules (man 7 glob) are not

Re: Binary serialization of a struct

2017-09-19 Thread Nordlöw via Digitalmars-d-learn
On Saturday, 16 September 2017 at 03:30:51 UTC, Joseph wrote: Are there any simple direct serialization libraries where I can mark elements of a class or struct that I want serialized with an attribute and it will take care of all the rest(including recursive structures, arrays, etc) then

Re: Binary serialization of a struct

2017-09-19 Thread spring via Digitalmars-d-learn
On Saturday, 16 September 2017 at 03:30:51 UTC, Joseph wrote: Are there any simple direct serialization libraries where I can mark elements of a class or struct that I want serialized with an attribute and it will take care of all the rest(including recursive structures, arrays, etc) then