Re: Rosetta Commatizing numbers

2017-06-01 Thread Ivan Kazmenko via Digitalmars-d-learn
On Thursday, 1 June 2017 at 08:45:23 UTC, Solomon E wrote: On Wednesday, 31 May 2017 at 15:44:51 UTC, Ivan Kazmenko wrote: So, two custom calls, two minor changes, no sweat. Is everything right now? Even if not: that was fast, we can do another iteration. When we have a short readable

Re: Rosetta Commatizing numbers

2017-06-01 Thread Solomon E via Digitalmars-d-learn
On Wednesday, 31 May 2017 at 15:44:51 UTC, Ivan Kazmenko wrote: So, two custom calls, two minor changes, no sweat. Is everything right now? Even if not: that was fast, we can do another iteration. When we have a short readable solution with no special cases, the first few changes are

Re: Rosetta Commatizing numbers

2017-05-31 Thread Solomon E via Digitalmars-d-learn
On Wednesday, 31 May 2017 at 15:44:51 UTC, Ivan Kazmenko wrote: On Wednesday, 31 May 2017 at 13:27:24 UTC, Solomon E wrote: Fine, by the numbers: 1. pi has the commas start at the wrong digit, and doesn't follow the explicit instructions to use spaces as the separator and a grouping of 5 Ca

Re: Rosetta Commatizing numbers

2017-05-31 Thread Mike B Johnson via Digitalmars-d-learn
If you still insist you are doing the right thing and all others are wrong, let's agree to disagree on that, and please just leave the original solution there by introducing two versions. Or we could just agree that the original was wrong and needs fixing? That is obviously the right thing to

Re: Rosetta Commatizing numbers

2017-05-31 Thread Ivan Kazmenko via Digitalmars-d-learn
On Wednesday, 31 May 2017 at 13:27:24 UTC, Solomon E wrote: Fine, by the numbers: 1. pi has the commas start at the wrong digit, and doesn't follow the explicit instructions to use spaces as the separator and a grouping of 5 Can be solved by calling the function with a right set of paramete

Re: Rosetta Commatizing numbers

2017-05-31 Thread Solomon E via Digitalmars-d-learn
On Wednesday, 31 May 2017 at 04:31:14 UTC, Ivan Kazmenko wrote: On Tuesday, 30 May 2017 at 10:54:49 UTC, Solomon E wrote: I ran into a Rosetta code solution in D that had obvious errors. It's like the author or the previous editor wasn't even trying to do it right, like a protest against how ma

Re: Rosetta Commatizing numbers

2017-05-30 Thread Ivan Kazmenko via Digitalmars-d-learn
On Wednesday, 31 May 2017 at 04:31:14 UTC, Ivan Kazmenko wrote: Now, where is the old version wrong? ... Actually, it also changes every number in the string, not only the first one as required. Because of that, it also fails the "do not touch the exponent" requirement. Sadly, both are not

Re: Rosetta Commatizing numbers

2017-05-30 Thread Ivan Kazmenko via Digitalmars-d-learn
On Tuesday, 30 May 2017 at 10:54:49 UTC, Solomon E wrote: I ran into a Rosetta code solution in D that had obvious errors. It's like the author or the previous editor wasn't even trying to do it right, like a protest against how many detailed rules the task had. I assumed that's not the way we

Re: Rosetta Commatizing numbers

2017-05-30 Thread Jordan Wilson via Digitalmars-d-learn
On Tuesday, 30 May 2017 at 10:54:49 UTC, Solomon E wrote: The earlier version of the page made D look more error prone than other languages, but short. Now my solution is as long as some of the other language's solutions, but it's well commented and tested, I think. Now I doubt any of the sol

Rosetta Commatizing numbers

2017-05-30 Thread Solomon E via Digitalmars-d-learn
I ran into a Rosetta code solution in D that had obvious errors. It's like the author or the previous editor wasn't even trying to do it right, like a protest against how many detailed rules the task had. I assumed that's not the way we want to do things in D. Then I spent all day fixing it. O