This program for instance compiles:
exception MyException of (list_vt(int))
fun test(l : list_vt(int)): void =
$raise MyException(l)
implement main0(argc,argv) =
test(list0_vt_cons(1,list0_vt_nil()))
but results in:
exit(ATS): uncaught exception at run-time:
I expect that but would also have expected that the type system would
require me to free 'l' at some point.
On Thursday, June 20, 2019 at 12:35:14 PM UTC-5, aditya siram wrote:
>
> Hi,
> That is closer but what I had in mind is what happens with an exception
> carries a linear resource, so in that example, imagine the exception was on
> the '~(x :: xs)' case and looked something like '$raise Exception(x)'. Here
> 'x' of type 'a' must be consumed whenever the exception is handled. My
> question is if the linear type system detects such cases.
>
>
> On Thursday, June 20, 2019 at 12:19:09 PM UTC-5, Richard wrote:
>>
>> Hello Aditya,
>>
>> I know this is not identical but checkout this example,
>>
>> https://github.com/githwxi/atslangweb/blob/master/ats2-lang/doc/EXAMPLE/INTRO/sieve_llazy.dats#L53
>>
>> The tilde tells the compiler to free the empty stream in this example.
>>
>> Is this similar to what you have in mind?
>>
>>
--
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 [email protected].
To post to this group, send email to [email protected].
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/945ac687-713b-4f2f-9aa7-6e8de11c46d9%40googlegroups.com.