What is aptr(l)? Here is some code that may be helpful:
extern fun {a:vt0p} ptr_alloc((*void*)) :<> [l:agz] (a? @ l, mfree_gc_v(l) | ptr(l)) // end of [ptr_alloc] extern fn {a:vt@ype} as_view(a): [l:addr | l > null] (a @ l, mfree_gc_v(l) | ptr(l)) implement {a} as_view(x) = let val (pf,fpf|p) = ptr_alloc<a>() in !p := x; (pf, fpf | p) end On Mon, Sep 3, 2018 at 9:15 PM Vanessa McHale <vanessa.mch...@iohk.io> wrote: > Is there any way to implement > > extern > fn {a:vt@ype} as_view (a) : [ l : addr | l > null ] (a @ l | aptr(l)) > > extern > fn {a:vt@ype} as_value {l:addr} ((a @ l | aptr(l))) : a > > ? > > I've tried using view@ and addr@ but it seems they're for stack > allocations. I suppose I could write my own view in place of using a @ > l, but I don't see any way around addr@. > > Thanks! > > > -- > 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/af2fe422-c973-2353-7d8d-b6719a5cdc1c%40iohk.io > . > -- 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/CAPPSPLomtbetFTQxN_L3D4NUrwDz2R7rn2dQrgQ%3DYDF0dmgW%2Bg%40mail.gmail.com.