I'm a little rusty, so can't come up with many good examples.
Apparently it is possible to do something like this in OCaml:
implement
main0 () = {
val () = let
val ha = print("ha")
in
(ha; ha) // How to get two ha's here?
end
}
After running the program, you would only see one
I think that might have do with laziness? If you have a side-effecting
expression and you try to pretend it's call-by-need, then bad things
happen (beta reduction is no longer valid!)
Do you have an example in OCaml? I admit I am curious as to why their
compiler would do such a thing.
On 3/20/19
On Wednesday, March 20, 2019 at 10:40:34 PM UTC-4, Vanessa McHale wrote:
>
> I think that might have do with laziness? If you have a side-effecting
> expression and you try to pretend it's call-by-need, then bad things happen
> (beta reduction is no longer valid!)
>
> Yes, that seems to be the