Re: Referential transparency in ATS

2019-03-20 Thread Brandon Barker
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

Re: Referential transparency in ATS

2019-03-20 Thread Vanessa McHale
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

Referential transparency in ATS

2019-03-20 Thread Brandon Barker
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