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 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-users+unsubscr...@googlegroups.com
> <mailto:ats-lang-users+unsubscr...@googlegroups.com>.
> To post to this group, send email to ats-lang-users@googlegroups.com
> <mailto: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/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/b5eac771-323c-da14-e639-b7e1822a4185%40iohk.io.

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to