Right now, 'lin' in the following declaration is ignored: fn g():<lin> void = ()
The only way to get a linear function is through 'llam'. On Fri, Aug 3, 2018 at 9:38 PM, 'Yannick Duchêne' via ats-lang-users < ats-lang-users@googlegroups.com> wrote: > I just checked this and got an unexpected result: > > This, is OK: > > viewtypedef t = () -<lin> void > > var f:t = llam() => () > val () = f() > // val () = f() // Error, evaluation is already consumed. > > This, is unexpected: > > fn g():<lin> void = () > > val () = g() > val () = g() // Should be an error but is not? > > I though the second evaluation would trigger an error, but since an > ordinary function is not an l‑value, may be it can’t be linear. But if this > is the explanation, then this effect should be rejected on ordinary > function. Unless I’m wrong … > > `$showtype` says `g` is of type sort, not viewtype sort. > > -- > 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/221f64a7-38e9-4a22-8767-c860587cfeee% > 40googlegroups.com > <https://groups.google.com/d/msgid/ats-lang-users/221f64a7-38e9-4a22-8767-c860587cfeee%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- 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/CAPPSPLqpG61Vd6Q_-Gi8wv4Jk8KM%2BiVr7Yo4Vp5aGo02ZSYcgA%40mail.gmail.com.