Re: Linear lazy stream, $ldelay, and freeing a single element.

2018-05-05 Thread Hongwei Xi
A linear stream is a bit like an object with two methods:
one for eval and the other for free; !xs calls the eval method
and ~xs calls the free method.

On Sun, May 6, 2018 at 12:11 AM, Steinway Wu  wrote:

> I have a follow up question. How does `~xs` as in `$ldelay(..., ~xs)`
> handle a stream of linear elements, or even linear closures?
>
> On Saturday, May 5, 2018 at 11:23:33 PM UTC-4, Steinway Wu wrote:
>>
>> Oh, there's a gfree_val and gfree_ref
>>
>> On Saturday, May 5, 2018 at 11:01:16 PM UTC-4, gmhwxi wrote:
>>>
>>> Is there a template called gfree? You can put gfree(x) there.
>>> For non-linear x,
>>>
>>> implement(a:t@ype) gfree(x) = ().
>>>
>>> On Saturday, May 5, 2018 at 10:51:34 PM UTC-4, Steinway Wu wrote:

 Hi,

 Even though `stream_vt (a)` is defined on `a: vt@ype`, many library
 functions for `stream_vt (a)` is only defined on `a: t@ype`. It feels
 like `a: t@ype` is easier to work with since there's no need to free a
 single element in some of the library functions, like
 `stream_vt_make_cons`. Is there other reasons not to support an element of
 some true view type? What should I put in the 2nd arg in `$ldelay` if I'd
 like to implement `stream_vt_make_cons` for `a: vt@ype`?

>>> --
> 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/b113df86-f9da-4ecf-9781-4eb0ef83dad3%
> 40googlegroups.com
> 
> .
>

-- 
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/CAPPSPLqU5ym43Jp4GsWT0LLvXFViVe3dmYAYgc6edECEpu7miA%40mail.gmail.com.


Re: Linear lazy stream, $ldelay, and freeing a single element.

2018-05-05 Thread Steinway Wu
I have a follow up question. How does `~xs` as in `$ldelay(..., ~xs)` 
handle a stream of linear elements, or even linear closures? 

On Saturday, May 5, 2018 at 11:23:33 PM UTC-4, Steinway Wu wrote:
>
> Oh, there's a gfree_val and gfree_ref
>
> On Saturday, May 5, 2018 at 11:01:16 PM UTC-4, gmhwxi wrote:
>>
>> Is there a template called gfree? You can put gfree(x) there.
>> For non-linear x,
>>
>> implement(a:t@ype) gfree(x) = ().
>>
>> On Saturday, May 5, 2018 at 10:51:34 PM UTC-4, Steinway Wu wrote:
>>>
>>> Hi, 
>>>
>>> Even though `stream_vt (a)` is defined on `a: vt@ype`, many library 
>>> functions for `stream_vt (a)` is only defined on `a: t@ype`. It feels like 
>>> `a: t@ype` is easier to work with since there's no need to free a single 
>>> element in some of the library functions, like `stream_vt_make_cons`. Is 
>>> there other reasons not to support an element of some true view type? What 
>>> should I put in the 2nd arg in `$ldelay` if I'd like to implement 
>>> `stream_vt_make_cons` for `a: vt@ype`? 
>>>
>>

-- 
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/b113df86-f9da-4ecf-9781-4eb0ef83dad3%40googlegroups.com.


Re: Linear lazy stream, $ldelay, and freeing a single element.

2018-05-05 Thread Steinway Wu
Oh, there's a gfree_val and gfree_ref

On Saturday, May 5, 2018 at 11:01:16 PM UTC-4, gmhwxi wrote:
>
> Is there a template called gfree? You can put gfree(x) there.
> For non-linear x,
>
> implement(a:t@ype) gfree(x) = ().
>
> On Saturday, May 5, 2018 at 10:51:34 PM UTC-4, Steinway Wu wrote:
>>
>> Hi, 
>>
>> Even though `stream_vt (a)` is defined on `a: vt@ype`, many library 
>> functions for `stream_vt (a)` is only defined on `a: t@ype`. It feels like 
>> `a: t@ype` is easier to work with since there's no need to free a single 
>> element in some of the library functions, like `stream_vt_make_cons`. Is 
>> there other reasons not to support an element of some true view type? What 
>> should I put in the 2nd arg in `$ldelay` if I'd like to implement 
>> `stream_vt_make_cons` for `a: vt@ype`? 
>>
>

-- 
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/0dba6dfd-46df-43ab-bf99-ee3b39ae35f4%40googlegroups.com.


Re: Linear lazy stream, $ldelay, and freeing a single element.

2018-05-05 Thread gmhwxi
Is there a template called gfree? You can put gfree(x) there.
For non-linear x,

implement(a:t@ype) gfree(x) = ().

On Saturday, May 5, 2018 at 10:51:34 PM UTC-4, Steinway Wu wrote:
>
> Hi, 
>
> Even though `stream_vt (a)` is defined on `a: vt@ype`, many library 
> functions for `stream_vt (a)` is only defined on `a: t@ype`. It feels like 
> `a: t@ype` is easier to work with since there's no need to free a single 
> element in some of the library functions, like `stream_vt_make_cons`. Is 
> there other reasons not to support an element of some true view type? What 
> should I put in the 2nd arg in `$ldelay` if I'd like to implement 
> `stream_vt_make_cons` for `a: vt@ype`? 
>

-- 
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/e62c4e9d-a6ef-4c7c-b7ec-47e1cda84bfd%40googlegroups.com.


Linear lazy stream, $ldelay, and freeing a single element.

2018-05-05 Thread Steinway Wu
Hi, 

Even though `stream_vt (a)` is defined on `a: vt@ype`, many library 
functions for `stream_vt (a)` is only defined on `a: t@ype`. It feels like 
`a: t@ype` is easier to work with since there's no need to free a single 
element in some of the library functions, like `stream_vt_make_cons`. Is 
there other reasons not to support an element of some true view type? What 
should I put in the 2nd arg in `$ldelay` if I'd like to implement 
`stream_vt_make_cons` for `a: vt@ype`? 

-- 
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/5dfad156-1e0f-47e7-890b-e91c3f4c2bfc%40googlegroups.com.