www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - wc.d program from the website

reply Russel Winder <russel winder.org.uk> writes:
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Does the code at http://dlang.org/wc.html represent the canonical D code
style?=20

I note that:

	rdmd wc.d < wc.d

fails to behave analogously to how:

	/usr/bin/wc < wc.d

does.
--=20
Russel.
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D
Dr Russel Winder      t: +44 20 7585 2200   voip: sip:russel.winder ekiga.n=
et
41 Buckmaster Road    m: +44 7770 465 077   xmpp: russel winder.org.uk
London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder
May 27 2013
parent "Peter Alexander" <peter.alexander.au gmail.com> writes:
On Monday, 27 May 2013 at 10:26:37 UTC, Russel Winder wrote:
 Does the code at http://dlang.org/wc.html represent the 
 canonical D code
 style?

 I note that:

 	rdmd wc.d < wc.d

 fails to behave analogously to how:

 	/usr/bin/wc < wc.d

 does.

I'm pretty sure canonical wc in D would use ranges now (spliter, byLine, walkLength). And yes, you are right about how it isn't very Unix-like with regards to how it handles the input.
May 27 2013