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 case with OCaml as far as I can tell.
 

> Do you have an example in OCaml? I admit I am curious as to why their 
> compiler would do such a thing.
>

The example I saw, which I hadn't tested as I've never used OCaml, was:

let val ha = (print "ha") in ha; ha end 

 

> On 3/20/19 8:45 PM, Brandon Barker wrote:
>
> 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 "ha", which violates RT.
>
> However, ATS doesn't seem to allow a sequence expression in the "in" 
> position of a let expression, as this doesn't compile. Admittedly I'm just 
> trying to see if ATS2 doesn't have RT in this particular case, but it would 
> also be good to know about the sequence expressions here.
> -- 
> You received this message because you are subscribed to the Google Groups 
> "ats-lang-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to ats-lang-user...@googlegroups.com <javascript:>.
> To post to this group, send email to ats-lan...@googlegroups.com 
> <javascript:>.
> Visit this group at https://groups.google.com/group/ats-lang-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/ats-lang-users/5eba6b86-4146-4ba2-a87f-f8c511d902f0%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/ats-lang-users/5eba6b86-4146-4ba2-a87f-f8c511d902f0%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"ats-lang-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ats-lang-users+unsubscr...@googlegroups.com.
To post to this group, send email to ats-lang-users@googlegroups.com.
Visit this group at https://groups.google.com/group/ats-lang-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ats-lang-users/2445b542-f850-4761-92f1-9375f1f610eb%40googlegroups.com.

Reply via email to