boxes tuples/records/etc & gc

25 views
Skip to first unread message

Raoul Duke

unread,
Aug 25, 2014, 1:30:12 PM8/25/14
to ats-lang-users
the docs say that with ! you have to use gc. but couldn't they be linear?

gmhwxi

unread,
Aug 25, 2014, 6:54:24 PM8/25/14
to ats-lan...@googlegroups.com
Where did you see it?

'!' means call-by-value.

T1 -> T2 is just essentially a shorthand for (!T1 >> T1) -> T2

Raoul Duke

unread,
Aug 25, 2014, 8:58:57 PM8/25/14
to ats-lang-users
sorry i was horribly unclear. :-) the docs say

http://www.ats-lang.org/DOCUMENT/INT2PROGINATS/HTML/x298.html

"However, if we want to run code with no support of garbage collection
(GC), then we should definitely avoid using boxed tuples."

if they were linear, then we could use them even w/out gc, no?

Hongwei Xi

unread,
Aug 25, 2014, 9:05:30 PM8/25/14
to ats-lan...@googlegroups.com
Yes, you can if they are linear.

In my own practice, I almost always use dataviewtypes for boxed linear tuples.
Usually, the easy way to go is to use datatypes first and then turn these datatypes
into corresponding dataviewtypes. Supporting this kind of gradual transitioning is
a big strength of ATS; it is part of the support for refinement-based programming.



--
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.
To post to this group, send email to ats-lan...@googlegroups.com.
Visit this group at http://groups.google.com/group/ats-lang-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/ats-lang-users/CAJ7XQb75qoXm1pXzzdvBoB9siOXqxj94GHYd7HZqDNthCP-GYA%40mail.gmail.com.

Reply all
Reply to author
Forward
0 new messages