On Thursday, March 21, 2019 at 8:39:10 AM UTC-4, gmhwxi wrote:
>
>
> >>ATS doesn't seem to allow a sequence expression in the "in" position of 
> a let expression,
>
> It does. You can write:
>
> implement
> main0 () =
> let
>   val ha = print("ha")
> in
>   ha; ha
> end
>
>
I think I tried that - but I tried it again verbatim, and I get:

$ patscc -o haha haha.dats 
In file included from haha_dats.c:15:0:
haha_dats.c: In function 'mainats_void_0':
haha_dats.c:179:26: error: 'tmp1' undeclared (first use in this function)
 ATSINSmove_void(tmpret0, tmp1) ;
                          ^
/nix/store/q8ll64apv4nn6x4dxprkjx29n3kwsraw-ats2-0.3.11/lib/ats2-postiats-
0.3.11/ccomp/runtime/pats_ccomp_instrset.h:284:39: note: in definition of 
macro 'ATSINSmove_void'
 #define ATSINSmove_void(tmp, command) command
                                       ^~~~~~~
haha_dats.c:179:26: note: each undeclared identifier is reported only once 
for each function it appears in
 ATSINSmove_void(tmpret0, tmp1) ;
                          ^
/nix/store/q8ll64apv4nn6x4dxprkjx29n3kwsraw-ats2-0.3.11/lib/ats2-postiats-
0.3.11/ccomp/runtime/pats_ccomp_instrset.h:284:39: note: in definition of 
macro 'ATSINSmove_void'
 #define ATSINSmove_void(tmp, command) command
                                       ^~~~~~~




 

> To get two ha's, you can write:
>
> implement
> main0 () =
> let
>   val ha = $delay(print("ha"))
> in
>   !ha; !ha
> end
>
> If you want 1000 ha's, you can do:
>
> #include "share/atspre_staload.hats"
> #include "share/atspre_staload_libats_ML.hats"
>
> implement
> main0 () =
> let
>   val ha = $delay(print("ha"))
> in
>   1000 * ha
> end
>
>
> On Wed, Mar 20, 2019 at 9:45 PM Brandon Barker <brandon...@gmail.com 
> <javascript:>> 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/45c7da36-ebcc-45b2-a9a1-dec98d1c2fbc%40googlegroups.com.

Reply via email to