wrt effect when assigning view of vtype reference

28 views
Skip to first unread message

Shea Levy

unread,
Nov 30, 2015, 8:34:09 PM11/30/15
to ats-lang-users
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

Hongwei Xi

unread,
Nov 30, 2015, 9:06:16 PM11/30/15
to ats-lan...@googlegroups.com
Thanks!

I fixed this one.

For now, you could do

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

to suppress the effect tracking.

--
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.

Reply all
Reply to author
Forward
0 new messages