Implicitly consumed views

Hi all,

Stack-allocated variables seem to be a special type of viewtype where
the view is implicitly consumed at the end of the scope. Is it possible
to define my own views like this , for example if I wanted to implement
my own garbage collector?

~Shea

Supporting RAII in a ATS-to-C compiler does not seem to be a good
design to me as doing it would require changing the dynamic semantics
of ATS. Also, linear types are a lot more flexible than RAII.

But it is conceivable for RAII to be some form of meta-programming
supported in a layer on top of ATS.On Sat, Sep 13, 2014 at 11:11 AM, Shea Levy sh...@shealevy.com wrote:

That being said, does ATS have a way to do RAII/‘destructors’? Some way
to say “if something of viewt@ype foo isn’t consumed at the end of scope
and the type signature doesn’t allow it to be preserved, call function
bar on it”?

~Shea

On Fri, Sep 12, 2014 at 01:57:03PM -0400, Shea Levy wrote:

Ah, actually I don’t have to use views at all and can just provide a
function to get an @-view for garbage-collected values when needed.
Never mind!

~Shea

On Fri, Sep 12, 2014 at 01:53:07PM -0400, Shea Levy wrote:

Hi all,

Stack-allocated variables seem to be a special type of viewtype where
the view is implicitly consumed at the end of the scope. Is it possible
to define my own views like this , for example if I wanted to implement
my own garbage collector?

~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/20140912175307.GC2251%40nixos.hsd1.nh.comcast.net
.


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/20140912175703.GA4120%40nixos.hsd1.nh.comcast.net
.


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/20140913151112.GA2275%40nixos.hsd1.nh.comcast.net
.

foo_acquire: unlocking a linear resource
foo_release: returning a previously acquired resource to a lock.On Saturday, September 13, 2014 8:13:05 PM UTC-4, gmhwxi wrote:

implement main () = let

val a_foo = allocate_foo ()
in free_foo a_foo; 0 end

I’m not sure why that’s a change to dynamic semantics, since it only
affects functions that otherwise wouldn’t compile.

Well, this is just one convention. Say I do something like:

let
val a_foo = foo_acquire()
val () = …
val () = foo_release (a_foo)
in
// nothing
end

If ‘foo_release’ is not called, a_foo is freed automatically. I would
rather
get a type-error message in this case. The point is that there are may be
more than one way to “free” a linear value.

It may sound a bit strange, but I, sometimes, see ATS as a form of
assembly. Programming
conventions should be pushed into meta-programming.

On Saturday, September 13, 2014 6:27:28 PM UTC-4, Shea Levy wrote:

Hm, perhaps RAII is the wrong name for it. Consider the following code:

absviewt@ype foo = int
extern fn allocate_foo(): foo
extern fn free_foo(foo): void
implement main () = let
val a_foo = allocate_foo ()
in 0 end

Currently this won’t compile of course, as ‘a_foo’ is preserved. I’d
like a way to say something like “if a value of type foo is preserved at
the end of a scope where it needs to be consumed, sequence free_foo(val)
before the returned expression”, so that the above implementation of
main would be equivalent to

implement main () = let
val a_foo = allocate_foo ()
in free_foo a_foo; 0 end

I’m not sure why that’s a change to dynamic semantics, since it only
affects functions that otherwise wouldn’t compile.

~Shea

On Sat, Sep 13, 2014 at 01:23:43PM -0400, Hongwei Xi wrote:

Supporting RAII in a ATS-to-C compiler does not seem to be a good
design to me as doing it would require changing the dynamic semantics
of ATS. Also, linear types are a lot more flexible than RAII.

But it is conceivable for RAII to be some form of meta-programming
supported in a layer on top of ATS.

On Sat, Sep 13, 2014 at 11:11 AM, Shea Levy sh...@shealevy.com wrote:

That being said, does ATS have a way to do RAII/‘destructors’? Some
way
to say “if something of viewt@ype foo isn’t consumed at the end of
scope
and the type signature doesn’t allow it to be preserved, call
function
bar on it”?

~Shea

On Fri, Sep 12, 2014 at 01:57:03PM -0400, Shea Levy wrote:

Ah, actually I don’t have to use views at all and can just provide
a
function to get an @-view for garbage-collected values when needed.
Never mind!

~Shea

On Fri, Sep 12, 2014 at 01:53:07PM -0400, Shea Levy wrote:

Hi all,

Stack-allocated variables seem to be a special type of viewtype
where
the view is implicitly consumed at the end of the scope. Is it
possible
to define my own views like this , for example if I wanted to
implement
my own garbage collector?

~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...@googlegroups.com.
To post to this group, send email to ats-l...@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/20140912175307.GC2251%40nixos.hsd1.nh.comcast.net

.


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...@googlegroups.com.
To post to this group, send email to ats-l...@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/20140912175703.GA4120%40nixos.hsd1.nh.comcast.net

.


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...@googlegroups.com.
To post to this group, send email to ats-l...@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/20140913151112.GA2275%40nixos.hsd1.nh.comcast.net

.


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...@googlegroups.com.
To post to this group, send email to ats-l...@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/CAPPSPLpo%3DB1kdEaUK5o8-31qsaLEXVR0no1Uh2VOw%3DaC%3DVRjJA%40mail.gmail.com.

Ah ha, that makes perfect sense, thanks!

~SheaOn Sat, Sep 13, 2014 at 05:15:06PM -0700, gmhwxi wrote:

foo_acquire: unlocking a linear resource
foo_release: returning a previously acquired resource to a lock.

On Saturday, September 13, 2014 8:13:05 PM UTC-4, gmhwxi wrote:

implement main () = let

val a_foo = allocate_foo ()
in free_foo a_foo; 0 end

I’m not sure why that’s a change to dynamic semantics, since it only
affects functions that otherwise wouldn’t compile.

Well, this is just one convention. Say I do something like:

let
val a_foo = foo_acquire()
val () = …
val () = foo_release (a_foo)
in
// nothing
end

If ‘foo_release’ is not called, a_foo is freed automatically. I would
rather
get a type-error message in this case. The point is that there are may be
more than one way to “free” a linear value.

It may sound a bit strange, but I, sometimes, see ATS as a form of
assembly. Programming
conventions should be pushed into meta-programming.

On Saturday, September 13, 2014 6:27:28 PM UTC-4, Shea Levy wrote:

Hm, perhaps RAII is the wrong name for it. Consider the following code:

absviewt@ype foo = int
extern fn allocate_foo(): foo
extern fn free_foo(foo): void
implement main () = let
val a_foo = allocate_foo ()
in 0 end

Currently this won’t compile of course, as ‘a_foo’ is preserved. I’d
like a way to say something like “if a value of type foo is preserved at
the end of a scope where it needs to be consumed, sequence free_foo(val)
before the returned expression”, so that the above implementation of
main would be equivalent to

implement main () = let
val a_foo = allocate_foo ()
in free_foo a_foo; 0 end

I’m not sure why that’s a change to dynamic semantics, since it only
affects functions that otherwise wouldn’t compile.

~Shea

On Sat, Sep 13, 2014 at 01:23:43PM -0400, Hongwei Xi wrote:

Supporting RAII in a ATS-to-C compiler does not seem to be a good
design to me as doing it would require changing the dynamic semantics
of ATS. Also, linear types are a lot more flexible than RAII.

But it is conceivable for RAII to be some form of meta-programming
supported in a layer on top of ATS.

On Sat, Sep 13, 2014 at 11:11 AM, Shea Levy sh...@shealevy.com wrote:

That being said, does ATS have a way to do RAII/‘destructors’? Some
way
to say “if something of viewt@ype foo isn’t consumed at the end of
scope
and the type signature doesn’t allow it to be preserved, call
function
bar on it”?

~Shea

On Fri, Sep 12, 2014 at 01:57:03PM -0400, Shea Levy wrote:

Ah, actually I don’t have to use views at all and can just provide
a
function to get an @-view for garbage-collected values when needed.
Never mind!

~Shea

On Fri, Sep 12, 2014 at 01:53:07PM -0400, Shea Levy wrote:

Hi all,

Stack-allocated variables seem to be a special type of viewtype
where
the view is implicitly consumed at the end of the scope. Is it
possible
to define my own views like this , for example if I wanted to
implement
my own garbage collector?

~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...@googlegroups.com.
To post to this group, send email to ats-l...@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/20140912175307.GC2251%40nixos.hsd1.nh.comcast.net

.


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...@googlegroups.com.
To post to this group, send email to ats-l...@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/20140912175703.GA4120%40nixos.hsd1.nh.comcast.net

.


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...@googlegroups.com.
To post to this group, send email to ats-l...@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/20140913151112.GA2275%40nixos.hsd1.nh.comcast.net

.


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...@googlegroups.com.
To post to this group, send email to ats-l...@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/CAPPSPLpo%3DB1kdEaUK5o8-31qsaLEXVR0no1Uh2VOw%3DaC%3DVRjJA%40mail.gmail.com.


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/6e4a66e8-bf35-4bad-aa51-b0052bf8a6ed%40googlegroups.com.

Hm, perhaps RAII is the wrong name for it. Consider the following code:

absviewt@ype foo = int
extern fn allocate_foo(): foo
extern fn free_foo(foo): void
implement main () = let
val a_foo = allocate_foo ()
in 0 end

Currently this won’t compile of course, as ‘a_foo’ is preserved. I’d
like a way to say something like “if a value of type foo is preserved at
the end of a scope where it needs to be consumed, sequence free_foo(val)
before the returned expression”, so that the above implementation of
main would be equivalent to

implement main () = let
val a_foo = allocate_foo ()
in free_foo a_foo; 0 end

I’m not sure why that’s a change to dynamic semantics, since it only
affects functions that otherwise wouldn’t compile.

~SheaOn Sat, Sep 13, 2014 at 01:23:43PM -0400, Hongwei Xi wrote:

Supporting RAII in a ATS-to-C compiler does not seem to be a good
design to me as doing it would require changing the dynamic semantics
of ATS. Also, linear types are a lot more flexible than RAII.

But it is conceivable for RAII to be some form of meta-programming
supported in a layer on top of ATS.

On Sat, Sep 13, 2014 at 11:11 AM, Shea Levy sh...@shealevy.com wrote:

That being said, does ATS have a way to do RAII/‘destructors’? Some way
to say “if something of viewt@ype foo isn’t consumed at the end of scope
and the type signature doesn’t allow it to be preserved, call function
bar on it”?

~Shea

On Fri, Sep 12, 2014 at 01:57:03PM -0400, Shea Levy wrote:

Ah, actually I don’t have to use views at all and can just provide a
function to get an @-view for garbage-collected values when needed.
Never mind!

~Shea

On Fri, Sep 12, 2014 at 01:53:07PM -0400, Shea Levy wrote:

Hi all,

Stack-allocated variables seem to be a special type of viewtype where
the view is implicitly consumed at the end of the scope. Is it possible
to define my own views like this , for example if I wanted to implement
my own garbage collector?

~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/20140912175307.GC2251%40nixos.hsd1.nh.comcast.net
.


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/20140912175703.GA4120%40nixos.hsd1.nh.comcast.net
.


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/20140913151112.GA2275%40nixos.hsd1.nh.comcast.net
.


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/CAPPSPLpo%3DB1kdEaUK5o8-31qsaLEXVR0no1Uh2VOw%3DaC%3DVRjJA%40mail.gmail.com.

Ah, actually I don’t have to use views at all and can just provide a
function to get an @-view for garbage-collected values when needed.
Never mind!

~SheaOn Fri, Sep 12, 2014 at 01:53:07PM -0400, Shea Levy wrote:

Hi all,

Stack-allocated variables seem to be a special type of viewtype where
the view is implicitly consumed at the end of the scope. Is it possible
to define my own views like this , for example if I wanted to implement
my own garbage collector?

~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/20140912175307.GC2251%40nixos.hsd1.nh.comcast.net.

Please, what is “RAII”?Le samedi 13 septembre 2014 17:11:20 UTC+2, Shea Levy a écrit :

That being said, does ATS have a way to do RAII/‘destructors’? Some way
to say “if something of viewt@ype foo isn’t consumed at the end of scope
and the type signature doesn’t allow it to be preserved, call function
bar on it”?

~Shea

On Fri, Sep 12, 2014 at 01:57:03PM -0400, Shea Levy wrote:

Ah, actually I don’t have to use views at all and can just provide a
function to get an @-view for garbage-collected values when needed.
Never mind!

~Shea

On Fri, Sep 12, 2014 at 01:53:07PM -0400, Shea Levy wrote:

Hi all,

Stack-allocated variables seem to be a special type of viewtype where
the view is implicitly consumed at the end of the scope. Is it
possible
to define my own views like this , for example if I wanted to
implement
my own garbage collector?

~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...@googlegroups.com <javascript:>.
To post to this group, send email to ats-l...@googlegroups.com
<javascript:>.
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/20140912175307.GC2251%40nixos.hsd1.nh.comcast.net.


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...@googlegroups.com <javascript:>.
To post to this group, send email to ats-l...@googlegroups.com
<javascript:>.
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/20140912175703.GA4120%40nixos.hsd1.nh.comcast.net.

implement main () = let
val a_foo = allocate_foo ()
in free_foo a_foo; 0 end

I’m not sure why that’s a change to dynamic semantics, since it only
affects functions that otherwise wouldn’t compile.

Well, this is just one convention. Say I do something like:

let
val a_foo = foo_acquire()
val () = …
val () = foo_release (a_foo)
in
// nothing
end

If ‘foo_release’ is not called, a_foo is freed automatically. I would rather
get a type-error message in this case. The point is that there are may be
more than one way to “free” a linear value.

It may sound a bit strange, but I, sometimes, see ATS as a form of
assembly. Programming
conventions should be pushed into meta-programming.On Saturday, September 13, 2014 6:27:28 PM UTC-4, Shea Levy wrote:

Hm, perhaps RAII is the wrong name for it. Consider the following code:

absviewt@ype foo = int
extern fn allocate_foo(): foo
extern fn free_foo(foo): void
implement main () = let
val a_foo = allocate_foo ()
in 0 end

Currently this won’t compile of course, as ‘a_foo’ is preserved. I’d
like a way to say something like “if a value of type foo is preserved at
the end of a scope where it needs to be consumed, sequence free_foo(val)
before the returned expression”, so that the above implementation of
main would be equivalent to

implement main () = let
val a_foo = allocate_foo ()
in free_foo a_foo; 0 end

I’m not sure why that’s a change to dynamic semantics, since it only
affects functions that otherwise wouldn’t compile.

~Shea

On Sat, Sep 13, 2014 at 01:23:43PM -0400, Hongwei Xi wrote:

Supporting RAII in a ATS-to-C compiler does not seem to be a good
design to me as doing it would require changing the dynamic semantics
of ATS. Also, linear types are a lot more flexible than RAII.

But it is conceivable for RAII to be some form of meta-programming
supported in a layer on top of ATS.

On Sat, Sep 13, 2014 at 11:11 AM, Shea Levy <sh...@shealevy.com <javascript:>> wrote:

That being said, does ATS have a way to do RAII/‘destructors’? Some
way
to say “if something of viewt@ype foo isn’t consumed at the end of
scope
and the type signature doesn’t allow it to be preserved, call function
bar on it”?

~Shea

On Fri, Sep 12, 2014 at 01:57:03PM -0400, Shea Levy wrote:

Ah, actually I don’t have to use views at all and can just provide a
function to get an @-view for garbage-collected values when needed.
Never mind!

~Shea

On Fri, Sep 12, 2014 at 01:53:07PM -0400, Shea Levy wrote:

Hi all,

Stack-allocated variables seem to be a special type of viewtype
where
the view is implicitly consumed at the end of the scope. Is it
possible
to define my own views like this , for example if I wanted to
implement
my own garbage collector?

~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...@googlegroups.com <javascript:>.
To post to this group, send email to ats-l...@googlegroups.com
<javascript:>.
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/20140912175307.GC2251%40nixos.hsd1.nh.comcast.net

.


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...@googlegroups.com <javascript:>.
To post to this group, send email to ats-l...@googlegroups.com
<javascript:>.
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/20140912175703.GA4120%40nixos.hsd1.nh.comcast.net

.


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...@googlegroups.com <javascript:>.
To post to this group, send email to ats-l...@googlegroups.com
<javascript:>.
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/20140913151112.GA2275%40nixos.hsd1.nh.comcast.net

.


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...@googlegroups.com <javascript:>.
To post to this group, send email to ats-l...@googlegroups.com
<javascript:>.
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/CAPPSPLpo%3DB1kdEaUK5o8-31qsaLEXVR0no1Uh2VOw%3DaC%3DVRjJA%40mail.gmail.com.

That being said, does ATS have a way to do RAII/‘destructors’? Some way
to say “if something of viewt@ype foo isn’t consumed at the end of scope
and the type signature doesn’t allow it to be preserved, call function
bar on it”?

~SheaOn Fri, Sep 12, 2014 at 01:57:03PM -0400, Shea Levy wrote:

Ah, actually I don’t have to use views at all and can just provide a
function to get an @-view for garbage-collected values when needed.
Never mind!

~Shea

On Fri, Sep 12, 2014 at 01:53:07PM -0400, Shea Levy wrote:

Hi all,

Stack-allocated variables seem to be a special type of viewtype where
the view is implicitly consumed at the end of the scope. Is it possible
to define my own views like this , for example if I wanted to implement
my own garbage collector?

~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/20140912175307.GC2251%40nixos.hsd1.nh.comcast.net.


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/20140912175703.GA4120%40nixos.hsd1.nh.comcast.net.

http://en.wikipedia.org/wiki/Resource_Acquisition_Is_InitializationOn Mon, Sep 29, 2014 at 12:46 AM, ‘Yannick Duchêne’ via ats-lang-users < ats-lan...@googlegroups.com> wrote:

Please, what is “RAII”?

Le samedi 13 septembre 2014 17:11:20 UTC+2, Shea Levy a écrit :

That being said, does ATS have a way to do RAII/‘destructors’? Some way
to say “if something of viewt@ype foo isn’t consumed at the end of scope
and the type signature doesn’t allow it to be preserved, call function
bar on it”?

~Shea

On Fri, Sep 12, 2014 at 01:57:03PM -0400, Shea Levy wrote:

Ah, actually I don’t have to use views at all and can just provide a
function to get an @-view for garbage-collected values when needed.
Never mind!

~Shea

On Fri, Sep 12, 2014 at 01:53:07PM -0400, Shea Levy wrote:

Hi all,

Stack-allocated variables seem to be a special type of viewtype where
the view is implicitly consumed at the end of the scope. Is it
possible
to define my own views like this , for example if I wanted to
implement
my own garbage collector?

~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...@googlegroups.com.
To post to this group, send email to ats-l...@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/20140912175307.GC2251%40nixos.hsd1.nh.comcast.net.


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...@googlegroups.com.
To post to this group, send email to ats-l...@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/20140912175703.GA4120%40nixos.hsd1.nh.comcast.net.


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/2517ec68-59ff-4eb4-80c4-25066965fdf9%40googlegroups.com
https://groups.google.com/d/msgid/ats-lang-users/2517ec68-59ff-4eb4-80c4-25066965fdf9%40googlegroups.com?utm_medium=email&utm_source=footer
.