Here are two examples that may be of interest:

fun
<x0:vt>
strm_vt_prepend0__llist0
(strm_vt(x0), list_vt(x0)): strm_vt(x0)

fun
<x0:vt>
strm_vt_prepend0__lstrm0
(strm_vt(x0), strm_vt(x0)): strm_vt(x0)

'strm_vt' means that the subject (1st argument) is a linear stream
'prepend0' is the verb indicating that the object (2nd argument) is
put in front of the subject; the lense 0 means that the subject is to be 
consumed
llist0/lstrm0 means that the object is a linear list/stream to be consumed 
by the function.

On Sunday, July 7, 2024 at 5:11:56 PM UTC-4 gmhwxi wrote:

>
> Instead of stating rules, I will just give a few examples. More will be 
> said later.
>
> Computing the length of a given list:
>
> fun list_length(xs: list(a)): sint
>
> Nothing special here. The full name of the function should be 
> list_length_sint
>
> Computing the length of a given linear list:
>
> fun list_vt_length0(xs: list_vt(a)): sint // xs is freed after the call
> fun list_vt_length1(xs: !list_vt(a)): sint // xs is still available after 
> the call
>
> Linear list reverse-append:
>
> fun list_vt_rappend01(xs: list_vt(a), ys: !list_vt(a)): list_vt(a)
>
> The full name of the function should be: list_vt_rappend0_llist__llist1.
> This name along indicates that the first argument (xs) is consumed;
> the second argument (ys) is kept (llist1); the return value is a linear 
> list
> (llist).
>
> Enough beans are spilled here :)
>
> Cheers,
>
> --Hongwei
>
>
>
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ats-lang-users/a6dc72a0-9df7-48f1-a203-560348732e12n%40googlegroups.com.

Reply via email to