Wrt effect when assigning view of vtype reference

Hi all,

With this code:

viewtypedef foo ( l : addr ) = @{ p = int @ l | v = ptr l }

fn bar { l : addr } ( f : &foo l ) : void = let
prval foo_p = f.p
prval () = f.p := foo_p
in () end

the compiler complains that “prval () = f.p := foo_p” may incur a wrt
effect (it allows me to write the line with val instead of prval though).
How can assigning to a view incur a wrt?

Thanks,
Shea

Thanks!

I fixed this one.

For now, you could do

prval () = $effmask_wrt(f.p := foo_p)

to suppress the effect tracking.On Mon, Nov 30, 2015 at 8:34 PM, Shea Levy sh...@shealevy.com wrote:

Hi all,

With this code:

viewtypedef foo ( l : addr ) = @{ p = int @ l | v = ptr l }

fn bar { l : addr } ( f : &foo l ) : void = let
prval foo_p = f.p
prval () = f.p := foo_p
in () end

the compiler complains that “prval () = f.p := foo_p” may incur a wrt
effect (it allows me to write the line with val instead of prval though).
How can assigning to a view incur a wrt?

Thanks,
Shea


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/54868575-6ac8-46f3-960a-72d66715aa61%40googlegroups.com
https://groups.google.com/d/msgid/ats-lang-users/54868575-6ac8-46f3-960a-72d66715aa61%40googlegroups.com?utm_medium=email&utm_source=footer
.