www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Example: wc

reply bachmeier <no spam.net> writes:
I was looking under "Books & Articles" and one of the submenu 
items is titled "Example: wc". So I thought it must be a heck of 
an example, but upon clicking, I saw a program with a bunch of 
nested foreach statements and no explanations. Why is this on the 
front page sidebar at all? It certainly doesn't belong under 
"Books & Articles" because it's just code.

Is this something we can move to the wiki? I will make the 
change, but I'm hoping somebody will say something if it belongs 
there.
Nov 23 2015
parent reply Chris <wendlec tcd.ie> writes:
On Monday, 23 November 2015 at 11:10:29 UTC, bachmeier wrote:
 I was looking under "Books & Articles" and one of the submenu 
 items is titled "Example: wc". So I thought it must be a heck 
 of an example, but upon clicking, I saw a program with a bunch 
 of nested foreach statements and no explanations. Why is this 
 on the front page sidebar at all? It certainly doesn't belong 
 under "Books & Articles" because it's just code.

 Is this something we can move to the wiki? I will make the 
 change, but I'm hoping somebody will say something if it 
 belongs there.
It used to be the code example displayed on the start page, if I remember correctly. Shouldn't it be put there (with some text that explains what's going on), if not already done so? Looks like it was temporarily "parked" under "Books & Articles" and forgotten.
Nov 23 2015
parent reply bachmeier <no spam.net> writes:
On Monday, 23 November 2015 at 12:19:08 UTC, Chris wrote:
 On Monday, 23 November 2015 at 11:10:29 UTC, bachmeier wrote:
 I was looking under "Books & Articles" and one of the submenu 
 items is titled "Example: wc". So I thought it must be a heck 
 of an example, but upon clicking, I saw a program with a bunch 
 of nested foreach statements and no explanations. Why is this 
 on the front page sidebar at all? It certainly doesn't belong 
 under "Books & Articles" because it's just code.

 Is this something we can move to the wiki? I will make the 
 change, but I'm hoping somebody will say something if it 
 belongs there.
It used to be the code example displayed on the start page, if I remember correctly. Shouldn't it be put there (with some text that explains what's going on), if not already done so? Looks like it was temporarily "parked" under "Books & Articles" and forgotten.
Okay. Do you know how to add it as a code example? It doesn't make a good first impression.
Nov 23 2015
parent reply Chris <wendlec tcd.ie> writes:
On Monday, 23 November 2015 at 12:44:55 UTC, bachmeier wrote:
 On Monday, 23 November 2015 at 12:19:08 UTC, Chris wrote:
 On Monday, 23 November 2015 at 11:10:29 UTC, bachmeier wrote:
 I was looking under "Books & Articles" and one of the submenu 
 items is titled "Example: wc". So I thought it must be a heck 
 of an example, but upon clicking, I saw a program with a 
 bunch of nested foreach statements and no explanations. Why 
 is this on the front page sidebar at all? It certainly 
 doesn't belong under "Books & Articles" because it's just 
 code.

 Is this something we can move to the wiki? I will make the 
 change, but I'm hoping somebody will say something if it 
 belongs there.
It used to be the code example displayed on the start page, if I remember correctly. Shouldn't it be put there (with some text that explains what's going on), if not already done so? Looks like it was temporarily "parked" under "Books & Articles" and forgotten.
Okay. Do you know how to add it as a code example? It doesn't make a good first impression.
The code doesn't look up to date and maybe it's been replaced with a more up to date example (i.e. with range chaining). It uses ulong instead of size_t. I dunno, maybe it should be dropped completely.
Nov 23 2015
next sibling parent Alex Parrill <initrd.gz gmail.com> writes:
On Monday, 23 November 2015 at 14:10:35 UTC, Chris wrote:
 The code doesn't look up to date and maybe it's been replaced 
 with a more up to date example (i.e. with range chaining). It 
 uses ulong instead of size_t. I dunno, maybe it should be 
 dropped completely.
ulong is appropriate here; the maximum word count should not be dependent on the system's memory limits, since it's streaming from an (arbitrary large) file.
Nov 23 2015
prev sibling parent bachmeier <no spam.com> writes:
On Monday, 23 November 2015 at 14:10:35 UTC, Chris wrote:

 The code doesn't look up to date and maybe it's been replaced 
 with a more up to date example (i.e. with range chaining). It 
 uses ulong instead of size_t. I dunno, maybe it should be 
 dropped completely.
https://github.com/D-Programming-Language/dlang.org/pull/1157
Nov 23 2015