zaxis wrote in article <27844016.p...@talk.nabble.com> in
gmane.comp.lang.haskell.cafe:
> As we know, the local variable is allocated on stack which is thread
> safe.
It's not.
http://en.wikipedia.org/wiki/Funarg_problem#Example
--
Edit this signature at http://www.digitas.harvard.edu/cgi-bin/
> So if the local variable can be changed, then we can use loop,
> etc. same as imperative languages. For example, for (i=0; i<100; i++)
> where `i` is a local variable in function.
It is true that a pure language could support such things (some pure
languages do, e.g. Sisal). The experience of
> From: zaxis
>
> So if the local variable can be changed, then we can use loop, etc. same as
> imperative languages. For example, for (i=0; i<100; i++) where `i` is a
> local variable in function.
>
In addition to John Millikin's suggestion, you can also do:
map f [0..99]
where f :: Int ->