|
|
>> Well, people claim that Lisp is an [impure] functional language too,
>> and AFAIK Erlang is about as pure as Lisp is.
>
> It's functional in the sense that you only assign once to a variable.
> It's not functional in the sense that calling "read" on the same file
> twice (in any language) can give you different results. Erlang just has
> lots more of that latter kind of non-functionalism.
>
> But yeah, you have to pass the seed to the random number generator, and
> it gives you back your random number and a new seed to remember for
> later. :-)
Well, "functional" tends to mean two things: referencial transparency,
and first-class functions. Lisp certainly has the latter, and seems to
suggest [although not enforce] the former. As for Erlang... *shrug*
In fact, all of the actually "popular" so-called functional languages
are impure. But then, the most popular OOP language is C++, which is
hardly a "pure" OOP language either...
> How does Haskell handle things like the function for "the time right now"?
Sure. To the nearest picosecond, anyway. You can also measure CPU time
instead of wall time of you want. You'll need a monad, obviously. ;-)
Post a reply to this message
|
|