|
|
Invisible wrote:
> The "get time" function just returns an I/O command object. You can
> replace that function call with the command object it returns and the
> meaning of the program is left completely unchanged. Thus it is
> referentially transparent.
So if I assign the result of "get time" to a variable and use that
variable in multiple places, do I get the same time each place I use it,
or different times? I think that's what's confusing me.
S = get_time()
print(S)
do_long_task()
print(S)
I would think you *want* that to do something different from
print(get_time())
do_long_task()
print(get_time())
How would I write each of those in Haskell?
--
Darren New / San Diego, CA, USA (PST)
"That's pretty. Where's that?"
"It's the Age of Channelwood."
"We should go there on vacation some time."
Post a reply to this message
|
|