Browse thread
The Implicit Accumulator: a design pattern using optional arguments
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| From: | Joel Reymont <joelr1@g...> |
| Subject: | Re: [Caml-list] The Implicit Accumulator: a design pattern using optional arguments |
Where does the 65% speed-up come from? Just from using match? On Jun 28, 2007, at 12:32 PM, Jon Harrop wrote: > I would write: > > let rec work sum = function > | 0 -> sum > | todo -> work (sum + todo) (todo - 1) > > let sum_nums n = work 0 n > > because it is shorter, clearer, 65% faster and it is idiomatic ML > rather than > idiomatic Lisp. -- http://topdog.cc - EasyLanguage to C# compiler http://wagerlabs.com - Blog