On Sat, 2013-03-16 at 21:06 -0400, Andrei Alexandrescu wrote: > On 3/16/13 10:42 AM, Suliman wrote: > > Hi folks! I had wrote small article about Rust vs D. I hope that you > > will like it! > > > > http://versusit.org/rust-vs-d > > Nice writeup. Could you please fix the code formatting? Indentation is > lost at least on Chrome and Firefox on OSX. Then I'll be glad to post on > reddit.
Sorry I forgot to add:
Can either of the codes calculate:
factorial(40)
?
i.e. are the codes at all relevant given that 32-bit and 64-bit integers
are useless for this calculation?
Python happily and correctly calculates factorial(2000).
Also if a functional approach is being advertised why use an imperative
algorithm for factorial, with it's explicit iteration, why not use
reduce so as to hide the itertation. In D:
reduce!"a * b"(1L, iota(1, n+1)(
It appears the 1L is needed here when using ulongs or type inference
fails :-(
--
Russel.
=============================================================================
Dr Russel Winder t: +44 20 7585 2200 voip: sip:[email protected]
41 Buckmaster Road m: +44 7770 465 077 xmpp: [email protected]
London SW11 1EN, UK w: www.russel.org.uk skype: russel_winder
signature.asc
Description: This is a digitally signed message part
