[…]
How can we then use the value to which r points? The following
code demonstrate a common way to do it:
(* ****** ****** *)
absvtype VT
(* ****** ****** *)
extern
fun foo (x: &VT): void // [foo] does processing in-situ.
(* ****** ****** *)
extern
fun foo2 (r: ref(VT)): void
implement foo2 (r) =
{
val (vbox pf | p) = ref_get_viewptr (r)
val () = $effmask_ref (foo (!p)) // [vbox] does not like the ref-effect!
}
It basically is an abstract dataprop parameterized by a view:absprop vbox (view)The view is linear, but the prop is not. Hence it disallows anyone to discard the view (only borrowing it temporarily is allowed). There probably is some special handling in the compiler.
--
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/46cf81c5-5682-4e72-95a4-aafb693f7297%40googlegroups.com.
Le mercredi 20 mai 2015 07:32:13 UTC+2, Artyom Shalkhakov a écrit :It basically is an abstract dataprop parameterized by a view:absprop vbox (view)The view is linear, but the prop is not. Hence it disallows anyone to discard the view (only borrowing it temporarily is allowed). There probably is some special handling in the compiler.Isn't it always the case? Or some view type aren't linear?
Certainly.
------ Original message------
From: Zhiqiang Ren
Date: Mon, Apr 4, 2016 3:02 PM
To: ats-lang-users;
Subject:Re: How to make use of a reference to a linear value?