Re: beginning with ML
- From: "michele.simionato@xxxxxxxxx" <michele.simionato@xxxxxxxxx>
- Date: Mon, 05 Nov 2007 10:57:47 -0000
On Nov 5, 11:26 am, Vesa Karvonen <vesa.karvo...@xxxxxxxxxxxxxx>
wrote:
What follows below is a similar program written in Standard ML using
no libraries beyond the Standard ML Basis library. It is by no means
the only way or the most elegant way to write such a program in ML.
It compiles with Alice ML as well as almost any SML compiler
(e.g. MLton, SML/NJ, Poly ML, MLKit, ...).
<snip>
That's interesting, thanks. It looks like loops are implemented
exactly as in Scheme.
Is there a "format" utility instead of performing string concatenation
by hand? Also,
you are mixing the formatting of the output with the generation of the
result (i.e. the
print statements are in the core routine). Suppose I want to
accumulate the result
before formatting. What's the preferred data structure? An association
list? A hash table?
What if I want to return the result lazily? Is there a "yield" concept
so that I could
return the averages one at the time?
Michele Simionato
.
- Follow-Ups:
- Re: beginning with ML
- From: David B. Benson
- Re: beginning with ML
- From: Vesa Karvonen
- Re: beginning with ML
- References:
- beginning with ML
- From: michele.simionato@xxxxxxxxx
- Re: beginning with ML
- From: Vesa Karvonen
- beginning with ML
- Prev by Date: Re: beginning with ML
- Next by Date: Re: beginning with ML
- Previous by thread: Re: beginning with ML
- Next by thread: Re: beginning with ML
- Index(es):
Relevant Pages
|