# ATS2-0.1.3 released

**URL:** <https://discourse.ats-lang.org/t/ats2-0-1-3-released/600>\
**Category:** Google Group\
**Created:** [September 29, 2014, 5:39pm UTC](https://discourse.ats-lang.org/t/ats2-0-1-3-released/600 "2014-09-29T17:39:10Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![gmhwxi](https://avatars.discourse-cdn.com/v4/letter/g/67e7ee/32.png) [@gmhwxi](https://discourse.ats-lang.org/u/gmhwxi)\
**Post date:** [September 29, 2014, 5:39pm UTC](https://discourse.ats-lang.org/t/ats2-0-1-3-released/600/1 "2014-09-29T17:39:10Z")

</div>

Hi,

I am glad to announce the release of ATS2-0.1.3.

The official website for ATS is: [http://www.ats-lang.org](http://www.ats-lang.org)

The following packages are included in this release:

ATS2-Postiats-0.1.3.tgz  
ATS2-Postiats-include-0.1.3.tgz

After installing ATS-Postiats-include, one can compile  
the C code generated from ATS source without installing  
the ATS compiler. So a convenient way to distribute software  
written in ATS is to simply release the C code generated  
from the ATS source.

See below for some major additions and changes in ATS2-0.1.3.

Cheers!

–Hongwei

This is the 12th release of ATS2, the successor of the ATS  
programming language. The compiler for ATS2 is given the name  
ATS/Positats, ATS2/Postiats or simply Postiats.

The official website for ATS is:

[http://www.ats-lang.org](http://www.ats-lang.org)

ATS-Postiats is hosted at github:

> **[githwxi/ATS-Postiats](https://github.com/githwxi/ATS-Postiats)**
>
> ATS2: Unleashing the Potentials of Types and Templates - githwxi/ATS-Postiats

Major releases of ATS2 are available at:

> **[ats2-lang](https://sourceforge.net/projects/ats2-lang/)**
>
> Download ats2-lang for free. ATS2: Unleashing the potentials of types and templates. ATS is a statically typed programming language that unifies implementation with formal specification. It is equipped with a highly expressive type system rooted in...

Major releases of external packages for ATS2 are available at:

> **[ats2-lang-contrib](https://sourceforge.net/projects/ats2-lang-contrib/)**
>
> Download ats2-lang-contrib for free. External Contributions to the ATS2 PL System. This project primarily consists of external contributions made to the ATS2 programming language system in the forms of library packages, tutorials, examples, and all...

Here is a list of major additions and changes since the last release:

1. Adding support for dot-notation overloading in assignments.  
This feature is mostly for interacting ATS with other languages.  
See ATS2TUTORIAL/CHAP\_DOTOVERLD for a short article of explanation.
2. Adding support for functional style o dot-notation overloading.  
This feature makes it very convenient for ATS to interact with OOP.
3. Generally improving level-2 jsonization (pats\_dynexp2\_jsonize)
4. Adding support for extvar decl. (which is different from $extval):  
extvar “external\_name” = internal\_value
5. ATS\_DYNLOADFLAG is set to 1 by default only for DATS-files. So  
dynloading SATS-files is no longer necessary (but it is still harmless).
6. Adding support for $extmcall(ret\_type, obj, “method”, arglst),  
which translates into the method invocation: obj.method(arglst)
7. Adding -D\_ATS\_ARRAY\_FIELD to safe-guard using array fields in records.

Slashdot TV. Videos for Nerds. Stuff that Matters.  
[http://pubads.g.doubleclick.net/gampad/clk?id=160591471&iu=/4140/ostg.clktrk](http://pubads.g.doubleclick.net/gampad/clk?id=160591471&iu=/4140/ostg.clktrk)  
ats-lang-users mailing list  
[ats-lan...@lists.sourceforge.net](mailto:ats-lan...@lists.sourceforge.net)  
[https://lists.sourceforge.net/lists/listinfo/ats-lang-users](https://lists.sourceforge.net/lists/listinfo/ats-lang-users)

---

<div class="post-metadata">

**Author:** ![Brandon\_Barker](https://sea1.discourse-cdn.com/flex019/user_avatar/discourse.ats-lang.org/brandon_barker/32/61_2.png) [@Brandon\_Barker](https://discourse.ats-lang.org/u/Brandon_Barker)\
**Post date:** [October 2, 2014, 11:00pm UTC](https://discourse.ats-lang.org/t/ats2-0-1-3-released/600/2 "2014-10-02T23:00:29Z")

</div>

It seems like in that case ‘get’ (or ‘get()’) would be the function part of  
the function all, and c0 would be the rest of it.

Also, why is it not an issue for nonlinear values; why must linear values  
require () for their dot-notation overloading? I suspect it may be a not so  
interesting complexity in the grammar, in which case, I’m happy to stop  
there :).On Thu, Oct 2, 2014 at 6:38 PM, gmhwxi [gmh...@gmail.com](mailto:gmh...@gmail.com) wrote:

> In a function call, you have a function and some arguments; c0.get should  
> be the  
> function part inside a function call.
> 
> On Thursday, October 2, 2014 4:31:14 PM UTC-4, Brandon Barker wrote:
> 
> > Regarding dot-notation overloading for linear values, I can appreciate  
> > that the handling might need to be different, but I don’t actually see  
> > where the linearity comes in to play. I also don’t really understand the  
> > statement: Instead, one needs to use c0.get \*as the function inside a  
> > function call \*in order to call counter\_get on c0:
> > 
> > val n0 = c0.get() // = counter\_get(c0)
> > 
> > On Mon, Sep 29, 2014 at 1:39 PM, Hongwei Xi [gmh...@gmail.com](mailto:gmh...@gmail.com) wrote:
> > 
> > > ---------- Forwarded message ----------  
> > > From: Hongwei Xi [hw...@bu.edu](mailto:hw...@bu.edu)  
> > > Date: Mon, Sep 29, 2014 at 1:37 PM  
> > > Subject: [ats-lang-users] ATS2-0.1.3 released  
> > > To: [ats-l...@lists.sourceforge.net](mailto:ats-l...@lists.sourceforge.net)
> > > 
> > > Hi,
> > > 
> > > I am glad to announce the release of ATS2-0.1.3.
> > > 
> > > The official website for ATS is: [http://www.ats-lang.org](http://www.ats-lang.org)
> > > 
> > > The following packages are included in this release:
> > > 
> > > ATS2-Postiats-0.1.3.tgz  
> > > ATS2-Postiats-include-0.1.3.tgz
> > > 
> > > After installing ATS-Postiats-include, one can compile  
> > > the C code generated from ATS source without installing  
> > > the ATS compiler. So a convenient way to distribute software  
> > > written in ATS is to simply release the C code generated  
> > > from the ATS source.
> > > 
> > > See below for some major additions and changes in ATS2-0.1.3.
> > > 
> > > Cheers!
> > > 
> > > –Hongwei
> > > 
> > > This is the 12th release of ATS2, the successor of the ATS  
> > > programming language. The compiler for ATS2 is given the name  
> > > ATS/Positats, ATS2/Postiats or simply Postiats.
> > > 
> > > The official website for ATS is:
> > > 
> > > [http://www.ats-lang.org](http://www.ats-lang.org)
> > > 
> > > ATS-Postiats is hosted at github:
> > > 
> > > [GitHub - githwxi/ATS-Postiats: ATS2: Unleashing the Potentials of Types and Templates](https://github.com/githwxi/ATS-Postiats)
> > > 
> > > Major releases of ATS2 are available at:
> > > 
> > > [ats2-lang download | SourceForge.net](https://sourceforge.net/projects/ats2-lang/)
> > > 
> > > Major releases of external packages for ATS2 are available at:
> > > 
> > > [ats2-lang-contrib download | SourceForge.net](https://sourceforge.net/projects/ats2-lang-contrib/)
> > > 
> > > Here is a list of major additions and changes since the last release:
> > > 
> > > 1. Adding support for dot-notation overloading in assignments.  
> > > This feature is mostly for interacting ATS with other languages.  
> > > See ATS2TUTORIAL/CHAP\_DOTOVERLD for a short article of explanation.
> > > 2. Adding support for functional style o dot-notation overloading.  
> > > This feature makes it very convenient for ATS to interact with OOP.
> > > 3. Generally improving level-2 jsonization (pats\_dynexp2\_jsonize)
> > > 4. Adding support for extvar decl. (which is different from $extval):  
> > > extvar “external\_name” = internal\_value
> > > 5. ATS\_DYNLOADFLAG is set to 1 by default only for DATS-files. So  
> > > dynloading SATS-files is no longer necessary (but it is still  
> > > harmless).
> > > 6. Adding support for $extmcall(ret\_type, obj, “method”, arglst),  
> > > which translates into the method invocation: obj.method(arglst)
> > > 7. Adding -D\_ATS\_ARRAY\_FIELD to safe-guard using array fields in records.
> > > 
> > > * * *
> > > 
> > > * * *
> > > 
> > > Slashdot TV. Videos for Nerds. Stuff that Matters.  
> > > [http://pubads.g.doubleclick.net/gampad/clk?id=160591471&](http://pubads.g.doubleclick.net/gampad/clk?id=160591471&)  
> > > iu=/4140/ostg.clktrk
> > > 
> > > * * *
> > > 
> > > ats-lang-users mailing list  
> > > [ats-l...@lists.sourceforge.net](mailto:ats-l...@lists.sourceforge.net)  
> > > [ats-lang-users List Signup and Options](https://lists.sourceforge.net/lists/listinfo/ats-lang-users)
> > > 
> > > –  
> > > 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](mailto:ats-lang...@googlegroups.com).  
> > > To post to this group, send email to [ats-l...@googlegroups.com](mailto:ats-l...@googlegroups.com).  
> > > Visit this group at [http://groups.google.com/group/ats-lang-users](http://groups.google.com/group/ats-lang-users).  
> > > To view this discussion on the web visit [https://groups.google.com/d/](https://groups.google.com/d/)  
> > > msgid/ats-lang-users/CAPPSPLrXVW-cXge0GccpOjFZf6p3CN5oLggbbaH2L  
> > > xX-E916uQ%[40mail.gmail.com](http://40mail.gmail.com)  
> > > [https://groups.google.com/d/msgid/ats-lang-users/CAPPSPLrXVW-cXge0GccpOjFZf6p3CN5oLggbbaH2LxX-E916uQ%40mail.gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/ats-lang-users/CAPPSPLrXVW-cXge0GccpOjFZf6p3CN5oLggbbaH2LxX-E916uQ%40mail.gmail.com?utm_medium=email&utm_source=footer)  
> > > .
> > 
> > –  
> > Brandon Barker  
> > [brand...@gmail.com](mailto:brand...@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](mailto:ats-lang-user...@googlegroups.com).  
> To post to this group, send email to [ats-lan...@googlegroups.com](mailto:ats-lan...@googlegroups.com).  
> Visit this group at [http://groups.google.com/group/ats-lang-users](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/79288e34-b6e8-4f4a-80cc-3a7ef3ff23ee%40googlegroups.com](https://groups.google.com/d/msgid/ats-lang-users/79288e34-b6e8-4f4a-80cc-3a7ef3ff23ee%40googlegroups.com)  
> [https://groups.google.com/d/msgid/ats-lang-users/79288e34-b6e8-4f4a-80cc-3a7ef3ff23ee%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/ats-lang-users/79288e34-b6e8-4f4a-80cc-3a7ef3ff23ee%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .

Brandon Barker  
[brandon...@gmail.com](mailto:brandon...@gmail.com)

---

<div class="post-metadata">

**Author:** ![gmhwxi](https://avatars.discourse-cdn.com/v4/letter/g/67e7ee/32.png) [@gmhwxi](https://discourse.ats-lang.org/u/gmhwxi)\
**Post date:** [October 3, 2014, 8:44pm UTC](https://discourse.ats-lang.org/t/ats2-0-1-3-released/600/3 "2014-10-03T20:44:49Z")

</div>

> > 1. Why can’t ‘foo’ be handled?  
> > It seems to not be an issue of typechecking, as I can make an example  
> > using ‘foo’ that typechecks. But of course it errors on \>\>compilation.

I would say that being able to handle ‘foo’ does not really make ATS more  
useful.  
For one thing, there is no easy way in ATS to initialize array fields in a  
safe manner.  
While it can be done, it is so involved that I doubt anyone wants to do it  
after going  
through the trouble once.

> > 1. If ‘foo2’ can be handled, why require a compiler argument?

To make sure that the user really knows what he is doing.On Fri, Oct 3, 2014 at 4:27 PM, Brandon Barker [brandon...@gmail.com](mailto:brandon...@gmail.com) wrote:

> This seems to raise two questions:
> 
> 1. Why can’t ‘foo’ be handled?  
> It seems to not be an issue of typechecking, as I can make an example  
> using ‘foo’ that typechecks. But of course it errors on compilation.
> 
> 2. If ‘foo2’ can be handled, why require a compiler argument?
> 
> My guess for this one is that having arrays of arbitrary size can be  
> unsafe (without using dependent types for array length), so the default is  
> to disallow it. This seems especially dangerous for an unboxed record as it  
> might create some issues on the stack?
> 
> Thanks,
> 
> On Fri, Oct 3, 2014 at 3:18 PM, Hongwei Xi [gmh...@gmail.com](mailto:gmh...@gmail.com) wrote:
> 
> > > > but could you post a short example about the use case for -  
> > > > D\_ATS\_ARRAY\_FIELD?
> > 
> > Say you declare a type foo as follows:
> > 
> > typedef foo = @{  
> > field= int  
> > , field2= string  
> > , field3= @[int][5] // this cannot be handled  
> > }
> > 
> > ATS will not be able to handle it correctly. Such a type should be given  
> > a name in C and then  
> > this name can be used in ATS. However, the following type declaration can  
> > be handled in ATS:
> > 
> > typedef foo2 = @{  
> > field= int  
> > , field2= string  
> > , field3= @[int] // this can be handled correctly.
> > 
> > If you want foo2 to be handled, then you need to have -D\_ATS\_ARRAY\_FIELD  
> > when compiling.
> > 
> > On Fri, Oct 3, 2014 at 10:04 AM, Brandon Barker \<[brandon...@gmail.com](mailto:brandon...@gmail.com) wrote:
> > 
> > > Is there any way to use $extmcall in C - perhaps if the object is a  
> > > struct and one of its fields is a function pointer? Admittedly this is  
> > > probably a rare situation, but am just curious.
> > > 
> > > Sorry for being possibly obtuse once again, but could you post a short  
> > > example about the use case for -D\_ATS\_ARRAY\_FIELD?
> > > 
> > > On Mon, Sep 29, 2014 at 1:39 PM, Hongwei Xi [gmh...@gmail.com](mailto:gmh...@gmail.com) wrote:
> > > 
> > > > ---------- Forwarded message ----------  
> > > > From: Hongwei Xi [hw...@bu.edu](mailto:hw...@bu.edu)  
> > > > Date: Mon, Sep 29, 2014 at 1:37 PM  
> > > > Subject: [ats-lang-users] ATS2-0.1.3 released  
> > > > To: [ats-lan...@lists.sourceforge.net](mailto:ats-lan...@lists.sourceforge.net)
> > > > 
> > > > Hi,
> > > > 
> > > > I am glad to announce the release of ATS2-0.1.3.
> > > > 
> > > > The official website for ATS is: [http://www.ats-lang.org](http://www.ats-lang.org)
> > > > 
> > > > The following packages are included in this release:
> > > > 
> > > > ATS2-Postiats-0.1.3.tgz  
> > > > ATS2-Postiats-include-0.1.3.tgz
> > > > 
> > > > After installing ATS-Postiats-include, one can compile  
> > > > the C code generated from ATS source without installing  
> > > > the ATS compiler. So a convenient way to distribute software  
> > > > written in ATS is to simply release the C code generated  
> > > > from the ATS source.
> > > > 
> > > > See below for some major additions and changes in ATS2-0.1.3.
> > > > 
> > > > Cheers!
> > > > 
> > > > –Hongwei
> > > > 
> > > > This is the 12th release of ATS2, the successor of the ATS  
> > > > programming language. The compiler for ATS2 is given the name  
> > > > ATS/Positats, ATS2/Postiats or simply Postiats.
> > > > 
> > > > The official website for ATS is:
> > > > 
> > > > [http://www.ats-lang.org](http://www.ats-lang.org)
> > > > 
> > > > ATS-Postiats is hosted at github:
> > > > 
> > > > [GitHub - githwxi/ATS-Postiats: ATS2: Unleashing the Potentials of Types and Templates](https://github.com/githwxi/ATS-Postiats)
> > > > 
> > > > Major releases of ATS2 are available at:
> > > > 
> > > > [ats2-lang download | SourceForge.net](https://sourceforge.net/projects/ats2-lang/)
> > > > 
> > > > Major releases of external packages for ATS2 are available at:
> > > > 
> > > > [ats2-lang-contrib download | SourceForge.net](https://sourceforge.net/projects/ats2-lang-contrib/)
> > > > 
> > > > Here is a list of major additions and changes since the last release:
> > > > 
> > > > 1. Adding support for dot-notation overloading in assignments.  
> > > > This feature is mostly for interacting ATS with other languages.  
> > > > See ATS2TUTORIAL/CHAP\_DOTOVERLD for a short article of explanation.
> > > > 2. Adding support for functional style o dot-notation overloading.  
> > > > This feature makes it very convenient for ATS to interact with OOP.
> > > > 3. Generally improving level-2 jsonization (pats\_dynexp2\_jsonize)
> > > > 4. Adding support for extvar decl. (which is different from $extval):  
> > > > extvar “external\_name” = internal\_value
> > > > 5. ATS\_DYNLOADFLAG is set to 1 by default only for DATS-files. So  
> > > > dynloading SATS-files is no longer necessary (but it is still  
> > > > harmless).
> > > > 6. Adding support for $extmcall(ret\_type, obj, “method”, arglst),  
> > > > which translates into the method invocation: obj.method(arglst)
> > > > 7. Adding -D\_ATS\_ARRAY\_FIELD to safe-guard using array fields in  
> > > > records.
> > > > 
> > > > * * *
> > > > 
> > > > Slashdot TV. Videos for Nerds. Stuff that Matters.
> > > > 
> > > > [http://pubads.g.doubleclick.net/gampad/clk?id=160591471&iu=/4140/ostg.clktrk](http://pubads.g.doubleclick.net/gampad/clk?id=160591471&iu=/4140/ostg.clktrk)
> > > > 
> > > > * * *
> > > > 
> > > > ats-lang-users mailing list  
> > > > [ats-lan...@lists.sourceforge.net](mailto:ats-lan...@lists.sourceforge.net)  
> > > > [ats-lang-users List Signup and Options](https://lists.sourceforge.net/lists/listinfo/ats-lang-users)
> > > > 
> > > > –  
> > > > 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](mailto:ats-lang-user...@googlegroups.com).  
> > > > To post to this group, send email to [ats-lan...@googlegroups.com](mailto:ats-lan...@googlegroups.com).  
> > > > Visit this group at [http://groups.google.com/group/ats-lang-users](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/CAPPSPLrXVW-cXge0GccpOjFZf6p3CN5oLggbbaH2LxX-E916uQ%40mail.gmail.com](https://groups.google.com/d/msgid/ats-lang-users/CAPPSPLrXVW-cXge0GccpOjFZf6p3CN5oLggbbaH2LxX-E916uQ%40mail.gmail.com)  
> > > > [https://groups.google.com/d/msgid/ats-lang-users/CAPPSPLrXVW-cXge0GccpOjFZf6p3CN5oLggbbaH2LxX-E916uQ%40mail.gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/ats-lang-users/CAPPSPLrXVW-cXge0GccpOjFZf6p3CN5oLggbbaH2LxX-E916uQ%40mail.gmail.com?utm_medium=email&utm_source=footer)  
> > > > .
> > > 
> > > –  
> > > Brandon Barker  
> > > [brandon...@gmail.com](mailto:brandon...@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](mailto:ats-lang-user...@googlegroups.com).  
> > > To post to this group, send email to [ats-lan...@googlegroups.com](mailto:ats-lan...@googlegroups.com).  
> > > Visit this group at [http://groups.google.com/group/ats-lang-users](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/CAORbNRpHLbLh0OvpqsC\_hyvefX18UMmrtsP6bmcoFrNbGx%2BQjg%40mail.gmail.com](https://groups.google.com/d/msgid/ats-lang-users/CAORbNRpHLbLh0OvpqsC_hyvefX18UMmrtsP6bmcoFrNbGx%2BQjg%40mail.gmail.com)  
> > > [https://groups.google.com/d/msgid/ats-lang-users/CAORbNRpHLbLh0OvpqsC\_hyvefX18UMmrtsP6bmcoFrNbGx%2BQjg%40mail.gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/ats-lang-users/CAORbNRpHLbLh0OvpqsC_hyvefX18UMmrtsP6bmcoFrNbGx%2BQjg%40mail.gmail.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-user...@googlegroups.com](mailto:ats-lang-user...@googlegroups.com).  
> > To post to this group, send email to [ats-lan...@googlegroups.com](mailto:ats-lan...@googlegroups.com).  
> > Visit this group at [http://groups.google.com/group/ats-lang-users](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/CAPPSPLqfVhhJ8qV5gHDGpnjPuiDu1GPQ2\_p-YbhVPqiFFPR1Lw%40mail.gmail.com](https://groups.google.com/d/msgid/ats-lang-users/CAPPSPLqfVhhJ8qV5gHDGpnjPuiDu1GPQ2_p-YbhVPqiFFPR1Lw%40mail.gmail.com)  
> > [https://groups.google.com/d/msgid/ats-lang-users/CAPPSPLqfVhhJ8qV5gHDGpnjPuiDu1GPQ2\_p-YbhVPqiFFPR1Lw%40mail.gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/ats-lang-users/CAPPSPLqfVhhJ8qV5gHDGpnjPuiDu1GPQ2_p-YbhVPqiFFPR1Lw%40mail.gmail.com?utm_medium=email&utm_source=footer)  
> > .
> 
> –  
> Brandon Barker  
> [brandon...@gmail.com](mailto:brandon...@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](mailto:ats-lang-user...@googlegroups.com).  
> To post to this group, send email to [ats-lan...@googlegroups.com](mailto:ats-lan...@googlegroups.com).  
> Visit this group at [http://groups.google.com/group/ats-lang-users](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/CAORbNRq-MEq2wZveSGohQyrGEOBL9fLAc3-kbmbZDR-xzOV7Vg%40mail.gmail.com](https://groups.google.com/d/msgid/ats-lang-users/CAORbNRq-MEq2wZveSGohQyrGEOBL9fLAc3-kbmbZDR-xzOV7Vg%40mail.gmail.com)  
> [https://groups.google.com/d/msgid/ats-lang-users/CAORbNRq-MEq2wZveSGohQyrGEOBL9fLAc3-kbmbZDR-xzOV7Vg%40mail.gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/ats-lang-users/CAORbNRq-MEq2wZveSGohQyrGEOBL9fLAc3-kbmbZDR-xzOV7Vg%40mail.gmail.com?utm_medium=email&utm_source=footer)  
> .

---

<div class="post-metadata">

**Author:** ![gmhwxi](https://avatars.discourse-cdn.com/v4/letter/g/67e7ee/32.png) [@gmhwxi](https://discourse.ats-lang.org/u/gmhwxi)\
**Post date:** [October 5, 2014, 12:52am UTC](https://discourse.ats-lang.org/t/ats2-0-1-3-released/600/4 "2014-10-05T00:52:53Z")

</div>

Assume that alloca should be avoided.  
Then an array-value @[int]n cannot be handled unless n  
is a constant.

As a value, @[int]n is read-only.

I just don’t feel that it is worth the effort to support this  
kind of read-only arrays in ATS. If it is really needed, then  
there is always a way to do it in C.

> > var my\_array = @[int]5

This isOn Saturday, October 4, 2014 6:33:23 PM UTC-4, Brandon Barker wrote:

> I thought this implied it was stack allocated. I also thought that record  
> types starting with ‘@’ are stack allocated unless explicitly put on the  
> heap (just like a struct in c), so it would seem these would be compatible.
> 
> But something does seem off. I actually thought
> 
> val x = …
> 
> implied stack allocation by default, unless some function using malloc is  
> employed or a nonlinear type is used. While, both of these typecheck, only  
> the latter compiles:
> 
> val my\_array = @[int]5
> 
> var my\_array = @[int]5
> 
> What am I missing/forgetting in this case?
> 
> Thanks,
> 
> On Friday, October 3, 2014 7:54:33 PM UTC-4, gmhwxi wrote:
> 
> > It is safe, but where do you store a value like @[int]5?
> > 
> > On Fri, Oct 3, 2014 at 6:02 PM, Brandon Barker [brand...@gmail.com](mailto:brand...@gmail.com) wrote:
> > 
> > > On Fri, Oct 3, 2014 at 4:44 PM, Hongwei Xi [gmh...@gmail.com](mailto:gmh...@gmail.com) wrote:
> > > 
> > > > > > 1. Why can’t ‘foo’ be handled?  
> > > > > > It seems to not be an issue of typechecking, as I can make an example  
> > > > > > using ‘foo’ that typechecks. But of course it errors on \>\>compilation.
> > > > 
> > > > I would say that being able to handle ‘foo’ does not really make ATS  
> > > > more useful.  
> > > > For one thing, there is no easy way in ATS to initialize array fields  
> > > > in a safe manner.  
> > > > While it can be done, it is so involved that I doubt anyone wants to do  
> > > > it after going  
> > > > through the trouble once.
> > > 
> > > What am I missing here? (this typechecks with the above ‘foo’ type, but  
> > > does not compile):
> > > 
> > > val x: foo = @{field = 1, field2 = “blah”, field3 = @[int]5}
> > > 
> > > This looks safe to me; field3 should be an integer array of length 5  
> > > with each entry initialized to 1?
> > > 
> > > > > > 1. If ‘foo2’ can be handled, why require a compiler argument?
> > > > 
> > > > To make sure that the user really knows what he is doing.
> > > > 
> > > > On Fri, Oct 3, 2014 at 4:27 PM, Brandon Barker [brand...@gmail.com](mailto:brand...@gmail.com) wrote:
> > > > 
> > > > > This seems to raise two questions:
> > > > > 
> > > > > 1. Why can’t ‘foo’ be handled?  
> > > > > It seems to not be an issue of typechecking, as I can make an example  
> > > > > using ‘foo’ that typechecks. But of course it errors on compilation.
> > > > > 
> > > > > 2. If ‘foo2’ can be handled, why require a compiler argument?
> > > > > 
> > > > > My guess for this one is that having arrays of arbitrary size can be  
> > > > > unsafe (without using dependent types for array length), so the default is  
> > > > > to disallow it. This seems especially dangerous for an unboxed record as it  
> > > > > might create some issues on the stack?
> > > > > 
> > > > > Thanks,
> > > > > 
> > > > > On Fri, Oct 3, 2014 at 3:18 PM, Hongwei Xi [gmh...@gmail.com](mailto:gmh...@gmail.com) wrote:
> > > > > 
> > > > > > > > but could you post a short example about the use case for -  
> > > > > > > > D\_ATS\_ARRAY\_FIELD?
> > > > > > 
> > > > > > Say you declare a type foo as follows:
> > > > > > 
> > > > > > typedef foo = @{  
> > > > > > field= int  
> > > > > > , field2= string  
> > > > > > , field3= @[int][5] // this cannot be handled  
> > > > > > }
> > > > > > 
> > > > > > ATS will not be able to handle it correctly. Such a type should be  
> > > > > > given a name in C and then  
> > > > > > this name can be used in ATS. However, the following type declaration  
> > > > > > can be handled in ATS:
> > > > > > 
> > > > > > typedef foo2 = @{  
> > > > > > field= int  
> > > > > > , field2= string  
> > > > > > , field3= @[int] // this can be handled correctly.
> > > > > > 
> > > > > > If you want foo2 to be handled, then you need to have  
> > > > > > -D\_ATS\_ARRAY\_FIELD when compiling.
> > > > > > 
> > > > > > On Fri, Oct 3, 2014 at 10:04 AM, Brandon Barker \<[brand...@gmail.com](mailto:brand...@gmail.com) wrote:
> > > > > > 
> > > > > > > Is there any way to use $extmcall in C - perhaps if the object is a  
> > > > > > > struct and one of its fields is a function pointer? Admittedly this is  
> > > > > > > probably a rare situation, but am just curious.
> > > > > > > 
> > > > > > > Sorry for being possibly obtuse once again, but could you post a  
> > > > > > > short example about the use case for -D\_ATS\_ARRAY\_FIELD?
> > > > > > > 
> > > > > > > On Mon, Sep 29, 2014 at 1:39 PM, Hongwei Xi [gmh...@gmail.com](mailto:gmh...@gmail.com) wrote:
> > > > > > > 
> > > > > > > > ---------- Forwarded message ----------  
> > > > > > > > From: Hongwei Xi [hw...@bu.edu](mailto:hw...@bu.edu)  
> > > > > > > > Date: Mon, Sep 29, 2014 at 1:37 PM  
> > > > > > > > Subject: [ats-lang-users] ATS2-0.1.3 released  
> > > > > > > > To: [ats-l...@lists.sourceforge.net](mailto:ats-l...@lists.sourceforge.net)
> > > > > > > > 
> > > > > > > > Hi,
> > > > > > > > 
> > > > > > > > I am glad to announce the release of ATS2-0.1.3.
> > > > > > > > 
> > > > > > > > The official website for ATS is: [http://www.ats-lang.org](http://www.ats-lang.org)
> > > > > > > > 
> > > > > > > > The following packages are included in this release:
> > > > > > > > 
> > > > > > > > ATS2-Postiats-0.1.3.tgz  
> > > > > > > > ATS2-Postiats-include-0.1.3.tgz
> > > > > > > > 
> > > > > > > > After installing ATS-Postiats-include, one can compile  
> > > > > > > > the C code generated from ATS source without installing  
> > > > > > > > the ATS compiler. So a convenient way to distribute software  
> > > > > > > > written in ATS is to simply release the C code generated  
> > > > > > > > from the ATS source.
> > > > > > > > 
> > > > > > > > See below for some major additions and changes in ATS2-0.1.3.
> > > > > > > > 
> > > > > > > > Cheers!
> > > > > > > > 
> > > > > > > > –Hongwei
> > > > > > > > 
> > > > > > > > This is the 12th release of ATS2, the successor of the ATS  
> > > > > > > > programming language. The compiler for ATS2 is given the name  
> > > > > > > > ATS/Positats, ATS2/Postiats or simply Postiats.
> > > > > > > > 
> > > > > > > > The official website for ATS is:
> > > > > > > > 
> > > > > > > > [http://www.ats-lang.org](http://www.ats-lang.org)
> > > > > > > > 
> > > > > > > > ATS-Postiats is hosted at github:
> > > > > > > > 
> > > > > > > > [GitHub - githwxi/ATS-Postiats: ATS2: Unleashing the Potentials of Types and Templates](https://github.com/githwxi/ATS-Postiats)
> > > > > > > > 
> > > > > > > > Major releases of ATS2 are available at:
> > > > > > > > 
> > > > > > > > [ats2-lang download | SourceForge.net](https://sourceforge.net/projects/ats2-lang/)
> > > > > > > > 
> > > > > > > > Major releases of external packages for ATS2 are available at:
> > > > > > > > 
> > > > > > > > [ats2-lang-contrib download | SourceForge.net](https://sourceforge.net/projects/ats2-lang-contrib/)
> > > > > > > > 
> > > > > > > > Here is a list of major additions and changes since the last  
> > > > > > > > release:
> > > > > > > > 
> > > > > > > > 1. Adding support for dot-notation overloading in assignments.  
> > > > > > > > This feature is mostly for interacting ATS with other languages.  
> > > > > > > > See ATS2TUTORIAL/CHAP\_DOTOVERLD for a short article of  
> > > > > > > > explanation.
> > > > > > > > 2. Adding support for functional style o dot-notation overloading.  
> > > > > > > > This feature makes it very convenient for ATS to interact with  
> > > > > > > > OOP.
> > > > > > > > 3. Generally improving level-2 jsonization (pats\_dynexp2\_jsonize)
> > > > > > > > 4. Adding support for extvar decl. (which is different from  
> > > > > > > > $extval):  
> > > > > > > > extvar “external\_name” = internal\_value
> > > > > > > > 5. ATS\_DYNLOADFLAG is set to 1 by default only for DATS-files. So  
> > > > > > > > dynloading SATS-files is no longer necessary (but it is still  
> > > > > > > > harmless).
> > > > > > > > 6. Adding support for $extmcall(ret\_type, obj, “method”, arglst),  
> > > > > > > > which translates into the method invocation: obj.method(arglst)
> > > > > > > > 7. Adding -D\_ATS\_ARRAY\_FIELD to safe-guard using array fields in  
> > > > > > > > records.
> > > > > > > > 
> > > > > > > > * * *
> > > > > > > > 
> > > > > > > > Slashdot TV. Videos for Nerds. Stuff that Matters.
> > > > > > > > 
> > > > > > > > [http://pubads.g.doubleclick.net/gampad/clk?id=160591471&iu=/4140/ostg.clktrk](http://pubads.g.doubleclick.net/gampad/clk?id=160591471&iu=/4140/ostg.clktrk)
> > > > > > > > 
> > > > > > > > * * *
> > > > > > > > 
> > > > > > > > ats-lang-users mailing list  
> > > > > > > > [ats-l...@lists.sourceforge.net](mailto:ats-l...@lists.sourceforge.net)  
> > > > > > > > [ats-lang-users List Signup and Options](https://lists.sourceforge.net/lists/listinfo/ats-lang-users)
> > > > > > > > 
> > > > > > > > –  
> > > > > > > > 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](mailto:ats-lang...@googlegroups.com).  
> > > > > > > > To post to this group, send email to [ats-l...@googlegroups.com](mailto:ats-l...@googlegroups.com).  
> > > > > > > > Visit this group at [http://groups.google.com/group/ats-lang-users](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/CAPPSPLrXVW-cXge0GccpOjFZf6p3CN5oLggbbaH2LxX-E916uQ%40mail.gmail.com](https://groups.google.com/d/msgid/ats-lang-users/CAPPSPLrXVW-cXge0GccpOjFZf6p3CN5oLggbbaH2LxX-E916uQ%40mail.gmail.com)  
> > > > > > > > [https://groups.google.com/d/msgid/ats-lang-users/CAPPSPLrXVW-cXge0GccpOjFZf6p3CN5oLggbbaH2LxX-E916uQ%40mail.gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/ats-lang-users/CAPPSPLrXVW-cXge0GccpOjFZf6p3CN5oLggbbaH2LxX-E916uQ%40mail.gmail.com?utm_medium=email&utm_source=footer)  
> > > > > > > > .
> > > > > > > 
> > > > > > > –  
> > > > > > > Brandon Barker  
> > > > > > > [brand...@gmail.com](mailto:brand...@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...@googlegroups.com](mailto:ats-lang...@googlegroups.com).  
> > > > > > > To post to this group, send email to [ats-l...@googlegroups.com](mailto:ats-l...@googlegroups.com).  
> > > > > > > Visit this group at [http://groups.google.com/group/ats-lang-users](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/CAORbNRpHLbLh0OvpqsC\_hyvefX18UMmrtsP6bmcoFrNbGx%2BQjg%40mail.gmail.com](https://groups.google.com/d/msgid/ats-lang-users/CAORbNRpHLbLh0OvpqsC_hyvefX18UMmrtsP6bmcoFrNbGx%2BQjg%40mail.gmail.com)  
> > > > > > > [https://groups.google.com/d/msgid/ats-lang-users/CAORbNRpHLbLh0OvpqsC\_hyvefX18UMmrtsP6bmcoFrNbGx%2BQjg%40mail.gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/ats-lang-users/CAORbNRpHLbLh0OvpqsC_hyvefX18UMmrtsP6bmcoFrNbGx%2BQjg%40mail.gmail.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...@googlegroups.com](mailto:ats-lang...@googlegroups.com).  
> > > > > > To post to this group, send email to [ats-l...@googlegroups.com](mailto:ats-l...@googlegroups.com).  
> > > > > > Visit this group at [http://groups.google.com/group/ats-lang-users](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/CAPPSPLqfVhhJ8qV5gHDGpnjPuiDu1GPQ2\_p-YbhVPqiFFPR1Lw%40mail.gmail.com](https://groups.google.com/d/msgid/ats-lang-users/CAPPSPLqfVhhJ8qV5gHDGpnjPuiDu1GPQ2_p-YbhVPqiFFPR1Lw%40mail.gmail.com)  
> > > > > > [https://groups.google.com/d/msgid/ats-lang-users/CAPPSPLqfVhhJ8qV5gHDGpnjPuiDu1GPQ2\_p-YbhVPqiFFPR1Lw%40mail.gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/ats-lang-users/CAPPSPLqfVhhJ8qV5gHDGpnjPuiDu1GPQ2_p-YbhVPqiFFPR1Lw%40mail.gmail.com?utm_medium=email&utm_source=footer)  
> > > > > > .
> > > > > 
> > > > > –  
> > > > > Brandon Barker  
> > > > > [brand...@gmail.com](mailto:brand...@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...@googlegroups.com](mailto:ats-lang...@googlegroups.com).  
> > > > > To post to this group, send email to [ats-l...@googlegroups.com](mailto:ats-l...@googlegroups.com).  
> > > > > Visit this group at [http://groups.google.com/group/ats-lang-users](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/CAORbNRq-MEq2wZveSGohQyrGEOBL9fLAc3-kbmbZDR-xzOV7Vg%40mail.gmail.com](https://groups.google.com/d/msgid/ats-lang-users/CAORbNRq-MEq2wZveSGohQyrGEOBL9fLAc3-kbmbZDR-xzOV7Vg%40mail.gmail.com)  
> > > > > [https://groups.google.com/d/msgid/ats-lang-users/CAORbNRq-MEq2wZveSGohQyrGEOBL9fLAc3-kbmbZDR-xzOV7Vg%40mail.gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/ats-lang-users/CAORbNRq-MEq2wZveSGohQyrGEOBL9fLAc3-kbmbZDR-xzOV7Vg%40mail.gmail.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...@googlegroups.com](mailto:ats-lang...@googlegroups.com).  
> > > > To post to this group, send email to [ats-l...@googlegroups.com](mailto:ats-l...@googlegroups.com).  
> > > > Visit this group at [http://groups.google.com/group/ats-lang-users](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/CAPPSPLrorB6aMys%3Dqv%3DbackaYe9SaKAZ6Y4gH9Jd2VfG7fT-Vw%40mail.gmail.com](https://groups.google.com/d/msgid/ats-lang-users/CAPPSPLrorB6aMys%3Dqv%3DbackaYe9SaKAZ6Y4gH9Jd2VfG7fT-Vw%40mail.gmail.com)  
> > > > [https://groups.google.com/d/msgid/ats-lang-users/CAPPSPLrorB6aMys%3Dqv%3DbackaYe9SaKAZ6Y4gH9Jd2VfG7fT-Vw%40mail.gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/ats-lang-users/CAPPSPLrorB6aMys%3Dqv%3DbackaYe9SaKAZ6Y4gH9Jd2VfG7fT-Vw%40mail.gmail.com?utm_medium=email&utm_source=footer)  
> > > > .
> > > 
> > > –  
> > > Brandon Barker  
> > > [brand...@gmail.com](mailto:brand...@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...@googlegroups.com](mailto:ats-lang...@googlegroups.com).  
> > > To post to this group, send email to [ats-l...@googlegroups.com](mailto:ats-l...@googlegroups.com).  
> > > Visit this group at [http://groups.google.com/group/ats-lang-users](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/CAORbNRpaPRKr8CxayVKZ6VzjV4cHxVew62DrwDa3wcPdTR75kQ%40mail.gmail.com](https://groups.google.com/d/msgid/ats-lang-users/CAORbNRpaPRKr8CxayVKZ6VzjV4cHxVew62DrwDa3wcPdTR75kQ%40mail.gmail.com)  
> > > [https://groups.google.com/d/msgid/ats-lang-users/CAORbNRpaPRKr8CxayVKZ6VzjV4cHxVew62DrwDa3wcPdTR75kQ%40mail.gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/ats-lang-users/CAORbNRpaPRKr8CxayVKZ6VzjV4cHxVew62DrwDa3wcPdTR75kQ%40mail.gmail.com?utm_medium=email&utm_source=footer)  
> > > .

---

<div class="post-metadata">

**Author:** ![gmhwxi](https://avatars.discourse-cdn.com/v4/letter/g/67e7ee/32.png) [@gmhwxi](https://discourse.ats-lang.org/u/gmhwxi)\
**Post date:** [October 2, 2014, 11:11pm UTC](https://discourse.ats-lang.org/t/ats2-0-1-3-released/600/5 "2014-10-02T23:11:49Z")

</div>

> > In a function call, you have a function and some arguments; c0.get should  
> > be the  
> > function part inside a function call.

In programming languages, the right terminology for this is to say that  
c0.get must be  
in an _applied_ position.On Thursday, October 2, 2014 7:00:50 PM UTC-4, Brandon Barker wrote:

> It seems like in that case ‘get’ (or ‘get()’) would be the function part  
> of the function all, and c0 would be the rest of it.
> 
> Also, why is it not an issue for nonlinear values; why must linear values  
> require () for their dot-notation overloading? I suspect it may be a not so  
> interesting complexity in the grammar, in which case, I’m happy to stop  
> there :).
> 
> On Thu, Oct 2, 2014 at 6:38 PM, gmhwxi \<[gmh...@gmail.com](mailto:gmh...@gmail.com) \<javascript:\>\> wrote:
> 
> > In a function call, you have a function and some arguments; c0.get should  
> > be the  
> > function part inside a function call.
> > 
> > On Thursday, October 2, 2014 4:31:14 PM UTC-4, Brandon Barker wrote:
> > 
> > > Regarding dot-notation overloading for linear values, I can appreciate  
> > > that the handling might need to be different, but I don’t actually see  
> > > where the linearity comes in to play. I also don’t really understand the  
> > > statement: Instead, one needs to use c0.get \*as the function inside a  
> > > function call \*in order to call counter\_get on c0:
> > > 
> > > val n0 = c0.get() // = counter\_get(c0)
> > > 
> > > On Mon, Sep 29, 2014 at 1:39 PM, Hongwei Xi [gmh...@gmail.com](mailto:gmh...@gmail.com) wrote:
> > > 
> > > > ---------- Forwarded message ----------  
> > > > From: Hongwei Xi [hw...@bu.edu](mailto:hw...@bu.edu)  
> > > > Date: Mon, Sep 29, 2014 at 1:37 PM  
> > > > Subject: [ats-lang-users] ATS2-0.1.3 released  
> > > > To: [ats-l...@lists.sourceforge.net](mailto:ats-l...@lists.sourceforge.net)
> > > > 
> > > > Hi,
> > > > 
> > > > I am glad to announce the release of ATS2-0.1.3.
> > > > 
> > > > The official website for ATS is: [http://www.ats-lang.org](http://www.ats-lang.org)
> > > > 
> > > > The following packages are included in this release:
> > > > 
> > > > ATS2-Postiats-0.1.3.tgz  
> > > > ATS2-Postiats-include-0.1.3.tgz
> > > > 
> > > > After installing ATS-Postiats-include, one can compile  
> > > > the C code generated from ATS source without installing  
> > > > the ATS compiler. So a convenient way to distribute software  
> > > > written in ATS is to simply release the C code generated  
> > > > from the ATS source.
> > > > 
> > > > See below for some major additions and changes in ATS2-0.1.3.
> > > > 
> > > > Cheers!
> > > > 
> > > > –Hongwei
> > > > 
> > > > This is the 12th release of ATS2, the successor of the ATS  
> > > > programming language. The compiler for ATS2 is given the name  
> > > > ATS/Positats, ATS2/Postiats or simply Postiats.
> > > > 
> > > > The official website for ATS is:
> > > > 
> > > > [http://www.ats-lang.org](http://www.ats-lang.org)
> > > > 
> > > > ATS-Postiats is hosted at github:
> > > > 
> > > > [GitHub - githwxi/ATS-Postiats: ATS2: Unleashing the Potentials of Types and Templates](https://github.com/githwxi/ATS-Postiats)
> > > > 
> > > > Major releases of ATS2 are available at:
> > > > 
> > > > [ats2-lang download | SourceForge.net](https://sourceforge.net/projects/ats2-lang/)
> > > > 
> > > > Major releases of external packages for ATS2 are available at:
> > > > 
> > > > [ats2-lang-contrib download | SourceForge.net](https://sourceforge.net/projects/ats2-lang-contrib/)
> > > > 
> > > > Here is a list of major additions and changes since the last release:
> > > > 
> > > > 1. Adding support for dot-notation overloading in assignments.  
> > > > This feature is mostly for interacting ATS with other languages.  
> > > > See ATS2TUTORIAL/CHAP\_DOTOVERLD for a short article of explanation.
> > > > 2. Adding support for functional style o dot-notation overloading.  
> > > > This feature makes it very convenient for ATS to interact with OOP.
> > > > 3. Generally improving level-2 jsonization (pats\_dynexp2\_jsonize)
> > > > 4. Adding support for extvar decl. (which is different from $extval):  
> > > > extvar “external\_name” = internal\_value
> > > > 5. ATS\_DYNLOADFLAG is set to 1 by default only for DATS-files. So  
> > > > dynloading SATS-files is no longer necessary (but it is still  
> > > > harmless).
> > > > 6. Adding support for $extmcall(ret\_type, obj, “method”, arglst),  
> > > > which translates into the method invocation: obj.method(arglst)
> > > > 7. Adding -D\_ATS\_ARRAY\_FIELD to safe-guard using array fields in  
> > > > records.
> > > > 
> > > > * * *
> > > > 
> > > > * * *
> > > > 
> > > > Slashdot TV. Videos for Nerds. Stuff that Matters.  
> > > > [http://pubads.g.doubleclick.net/gampad/clk?id=160591471&](http://pubads.g.doubleclick.net/gampad/clk?id=160591471&)  
> > > > iu=/4140/ostg.clktrk
> > > > 
> > > > * * *
> > > > 
> > > > ats-lang-users mailing list  
> > > > [ats-l...@lists.sourceforge.net](mailto:ats-l...@lists.sourceforge.net)  
> > > > [ats-lang-users List Signup and Options](https://lists.sourceforge.net/lists/listinfo/ats-lang-users)
> > > > 
> > > > –  
> > > > 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](mailto:ats-lang...@googlegroups.com).  
> > > > To post to this group, send email to [ats-l...@googlegroups.com](mailto:ats-l...@googlegroups.com).  
> > > > Visit this group at [http://groups.google.com/group/ats-lang-users](http://groups.google.com/group/ats-lang-users).  
> > > > To view this discussion on the web visit [https://groups.google.com/d/](https://groups.google.com/d/)  
> > > > msgid/ats-lang-users/CAPPSPLrXVW-cXge0GccpOjFZf6p3CN5oLggbbaH2L  
> > > > xX-E916uQ%[40mail.gmail.com](http://40mail.gmail.com)  
> > > > [https://groups.google.com/d/msgid/ats-lang-users/CAPPSPLrXVW-cXge0GccpOjFZf6p3CN5oLggbbaH2LxX-E916uQ%40mail.gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/ats-lang-users/CAPPSPLrXVW-cXge0GccpOjFZf6p3CN5oLggbbaH2LxX-E916uQ%40mail.gmail.com?utm_medium=email&utm_source=footer)  
> > > > .
> > > 
> > > –  
> > > Brandon Barker  
> > > [brand...@gmail.com](mailto:brand...@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...@googlegroups.com](mailto:ats-lang...@googlegroups.com) \<javascript:\>.  
> > To post to this group, send email to [ats-l...@googlegroups.com](mailto:ats-l...@googlegroups.com)  
> > \<javascript:\>.  
> > Visit this group at [http://groups.google.com/group/ats-lang-users](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/79288e34-b6e8-4f4a-80cc-3a7ef3ff23ee%40googlegroups.com](https://groups.google.com/d/msgid/ats-lang-users/79288e34-b6e8-4f4a-80cc-3a7ef3ff23ee%40googlegroups.com)  
> > [https://groups.google.com/d/msgid/ats-lang-users/79288e34-b6e8-4f4a-80cc-3a7ef3ff23ee%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/ats-lang-users/79288e34-b6e8-4f4a-80cc-3a7ef3ff23ee%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > .
> 
> –  
> Brandon Barker  
> [brand...@gmail.com](mailto:brand...@gmail.com) \<javascript:\>

---

<div class="post-metadata">

**Author:** ![Brandon\_Barker](https://sea1.discourse-cdn.com/flex019/user_avatar/discourse.ats-lang.org/brandon_barker/32/61_2.png) [@Brandon\_Barker](https://discourse.ats-lang.org/u/Brandon_Barker)\
**Post date:** [October 3, 2014, 1:49pm UTC](https://discourse.ats-lang.org/t/ats2-0-1-3-released/600/6 "2014-10-03T13:49:23Z")

</div>

Ah, yes now I see the intent a bit better - thanks.On Thu, Oct 2, 2014 at 7:08 PM, gmhwxi [gmh...@gmail.com](mailto:gmh...@gmail.com) wrote:

> You can do
> 
> foo.x := x0
> 
> but you cannot do
> 
> foo.x() := x0
> 
> The plain dot notation and the functional dot notation have to be handled  
> differently.
> 
> On Thursday, October 2, 2014 7:00:50 PM UTC-4, Brandon Barker wrote:
> 
> > It seems like in that case ‘get’ (or ‘get()’) would be the function part  
> > of the function all, and c0 would be the rest of it.
> > 
> > Also, why is it not an issue for nonlinear values; why must linear values  
> > require () for their dot-notation overloading? I suspect it may be a not so  
> > interesting complexity in the grammar, in which case, I’m happy to stop  
> > there :).
> > 
> > On Thu, Oct 2, 2014 at 6:38 PM, gmhwxi [gmh...@gmail.com](mailto:gmh...@gmail.com) wrote:
> > 
> > > In a function call, you have a function and some arguments; c0.get  
> > > should be the  
> > > function part inside a function call.
> > > 
> > > On Thursday, October 2, 2014 4:31:14 PM UTC-4, Brandon Barker wrote:
> > > 
> > > > Regarding dot-notation overloading for linear values, I can appreciate  
> > > > that the handling might need to be different, but I don’t actually see  
> > > > where the linearity comes in to play. I also don’t really understand the  
> > > > statement: Instead, one needs to use c0.get \*as the function inside a  
> > > > function call \*in order to call counter\_get on c0:
> > > > 
> > > > val n0 = c0.get() // = counter\_get(c0)
> > > > 
> > > > On Mon, Sep 29, 2014 at 1:39 PM, Hongwei Xi [gmh...@gmail.com](mailto:gmh...@gmail.com) wrote:
> > > > 
> > > > > ---------- Forwarded message ----------  
> > > > > From: Hongwei Xi [hw...@bu.edu](mailto:hw...@bu.edu)  
> > > > > Date: Mon, Sep 29, 2014 at 1:37 PM  
> > > > > Subject: [ats-lang-users] ATS2-0.1.3 released  
> > > > > To: [ats-l...@lists.sourceforge.net](mailto:ats-l...@lists.sourceforge.net)
> > > > > 
> > > > > Hi,
> > > > > 
> > > > > I am glad to announce the release of ATS2-0.1.3.
> > > > > 
> > > > > The official website for ATS is: [http://www.ats-lang.org](http://www.ats-lang.org)
> > > > > 
> > > > > The following packages are included in this release:
> > > > > 
> > > > > ATS2-Postiats-0.1.3.tgz  
> > > > > ATS2-Postiats-include-0.1.3.tgz
> > > > > 
> > > > > After installing ATS-Postiats-include, one can compile  
> > > > > the C code generated from ATS source without installing  
> > > > > the ATS compiler. So a convenient way to distribute software  
> > > > > written in ATS is to simply release the C code generated  
> > > > > from the ATS source.
> > > > > 
> > > > > See below for some major additions and changes in ATS2-0.1.3.
> > > > > 
> > > > > Cheers!
> > > > > 
> > > > > –Hongwei
> > > > > 
> > > > > This is the 12th release of ATS2, the successor of the ATS  
> > > > > programming language. The compiler for ATS2 is given the name  
> > > > > ATS/Positats, ATS2/Postiats or simply Postiats.
> > > > > 
> > > > > The official website for ATS is:
> > > > > 
> > > > > [http://www.ats-lang.org](http://www.ats-lang.org)
> > > > > 
> > > > > ATS-Postiats is hosted at github:
> > > > > 
> > > > > [GitHub - githwxi/ATS-Postiats: ATS2: Unleashing the Potentials of Types and Templates](https://github.com/githwxi/ATS-Postiats)
> > > > > 
> > > > > Major releases of ATS2 are available at:
> > > > > 
> > > > > [ats2-lang download | SourceForge.net](https://sourceforge.net/projects/ats2-lang/)
> > > > > 
> > > > > Major releases of external packages for ATS2 are available at:
> > > > > 
> > > > > [ats2-lang-contrib download | SourceForge.net](https://sourceforge.net/projects/ats2-lang-contrib/)
> > > > > 
> > > > > Here is a list of major additions and changes since the last release:
> > > > > 
> > > > > 1. Adding support for dot-notation overloading in assignments.  
> > > > > This feature is mostly for interacting ATS with other languages.  
> > > > > See ATS2TUTORIAL/CHAP\_DOTOVERLD for a short article of explanation.
> > > > > 2. Adding support for functional style o dot-notation overloading.  
> > > > > This feature makes it very convenient for ATS to interact with OOP.
> > > > > 3. Generally improving level-2 jsonization (pats\_dynexp2\_jsonize)
> > > > > 4. Adding support for extvar decl. (which is different from $extval):  
> > > > > extvar “external\_name” = internal\_value
> > > > > 5. ATS\_DYNLOADFLAG is set to 1 by default only for DATS-files. So  
> > > > > dynloading SATS-files is no longer necessary (but it is still  
> > > > > harmless).
> > > > > 6. Adding support for $extmcall(ret\_type, obj, “method”, arglst),  
> > > > > which translates into the method invocation: obj.method(arglst)
> > > > > 7. Adding -D\_ATS\_ARRAY\_FIELD to safe-guard using array fields in  
> > > > > records.
> > > > > 
> > > > > * * *
> > > > > 
> > > > > * * *
> > > > > 
> > > > > Slashdot TV. Videos for Nerds. Stuff that Matters.  
> > > > > [http://pubads.g.doubleclick.net/gampad/clk?id=160591471&iu=/](http://pubads.g.doubleclick.net/gampad/clk?id=160591471&iu=/)  
> > > > > 4140/ostg.clktrk
> > > > > 
> > > > > * * *
> > > > > 
> > > > > ats-lang-users mailing list  
> > > > > [ats-l...@lists.sourceforge.net](mailto:ats-l...@lists.sourceforge.net)  
> > > > > [ats-lang-users List Signup and Options](https://lists.sourceforge.net/lists/listinfo/ats-lang-users)
> > > > > 
> > > > > –  
> > > > > 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](mailto:ats-lang...@googlegroups.com).  
> > > > > To post to this group, send email to [ats-l...@googlegroups.com](mailto:ats-l...@googlegroups.com).  
> > > > > Visit this group at [http://groups.google.com/group/ats-lang-users](http://groups.google.com/group/ats-lang-users).  
> > > > > To view this discussion on the web visit [https://groups.google.com/d/](https://groups.google.com/d/)  
> > > > > msgid/ats-lang-users/CAPPSPLrXVW-cXge0GccpOjFZf6p3CN5oLggbbaH2L  
> > > > > xX-E916uQ%[40mail.gmail.com](http://40mail.gmail.com)  
> > > > > [https://groups.google.com/d/msgid/ats-lang-users/CAPPSPLrXVW-cXge0GccpOjFZf6p3CN5oLggbbaH2LxX-E916uQ%40mail.gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/ats-lang-users/CAPPSPLrXVW-cXge0GccpOjFZf6p3CN5oLggbbaH2LxX-E916uQ%40mail.gmail.com?utm_medium=email&utm_source=footer)  
> > > > > .
> > > > 
> > > > –  
> > > > Brandon Barker  
> > > > [brand...@gmail.com](mailto:brand...@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...@googlegroups.com](mailto:ats-lang...@googlegroups.com).  
> > > To post to this group, send email to [ats-l...@googlegroups.com](mailto:ats-l...@googlegroups.com).  
> > > Visit this group at [http://groups.google.com/group/ats-lang-users](http://groups.google.com/group/ats-lang-users).  
> > > To view this discussion on the web visit [https://groups.google.com/d/](https://groups.google.com/d/)  
> > > msgid/ats-lang-users/79288e34-b6e8-4f4a-80cc-3a7ef3ff23ee%  
> > > [40googlegroups.com](http://40googlegroups.com)  
> > > [https://groups.google.com/d/msgid/ats-lang-users/79288e34-b6e8-4f4a-80cc-3a7ef3ff23ee%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/ats-lang-users/79288e34-b6e8-4f4a-80cc-3a7ef3ff23ee%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > .
> > 
> > –  
> > Brandon Barker  
> > [brand...@gmail.com](mailto:brand...@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](mailto:ats-lang-user...@googlegroups.com).  
> To post to this group, send email to [ats-lan...@googlegroups.com](mailto:ats-lan...@googlegroups.com).  
> Visit this group at [http://groups.google.com/group/ats-lang-users](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/ba59ab8d-5c2f-46da-8712-a3452c4be957%40googlegroups.com](https://groups.google.com/d/msgid/ats-lang-users/ba59ab8d-5c2f-46da-8712-a3452c4be957%40googlegroups.com)  
> [https://groups.google.com/d/msgid/ats-lang-users/ba59ab8d-5c2f-46da-8712-a3452c4be957%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/ats-lang-users/ba59ab8d-5c2f-46da-8712-a3452c4be957%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .

Brandon Barker  
[brandon...@gmail.com](mailto:brandon...@gmail.com)

---

<div class="post-metadata">

**Author:** ![Brandon\_Barker](https://sea1.discourse-cdn.com/flex019/user_avatar/discourse.ats-lang.org/brandon_barker/32/61_2.png) [@Brandon\_Barker](https://discourse.ats-lang.org/u/Brandon_Barker)\
**Post date:** [October 6, 2014, 6:17pm UTC](https://discourse.ats-lang.org/t/ats2-0-1-3-released/600/7 "2014-10-06T18:17:20Z")

</div>

> Assume that alloca should be avoided.  
> Then an array-value @[int]n cannot be handled unless n  
> is a constant.
> 
> As a value, @[int]n is read-only.
> 
> I just don’t feel that it is worth the effort to support this  
> kind of read-only arrays in ATS. If it is really needed, then  
> there is always a way to do it in C.

That sounds reasonable and fair. I just didn’t know that was the issue at hand.  
I’ll try to add some of this to the wiki soon.

> > > var my\_array = @[int]5
> 
> This is

> > I thought this implied it was stack allocated. I also thought that record  
> > types starting with ‘@’ are stack allocated unless explicitly put on the  
> > heap (just like a struct in c), so it would seem these would be compatible.
> > 
> > But something does seem off. I actually thought
> > 
> > val x = …
> > 
> > implied stack allocation by default, unless some function using malloc is  
> > employed or a nonlinear type is used. While, both of these typecheck, only  
> > the latter compiles:
> > 
> > val my\_array = @[int]5
> > 
> > var my\_array = @[int]5
> > 
> > What am I missing/forgetting in this case?
> > 
> > Thanks,

> > > It is safe, but where do you store a value like @[int]5?

> > > >

> > > > > > > 1. Why can’t ‘foo’ be handled?  
> > > > > > > It seems to not be an issue of typechecking, as I can make an example  
> > > > > > > using ‘foo’ that typechecks. But of course it errors on \>\>compilation.
> > > > > 
> > > > > I would say that being able to handle ‘foo’ does not really make ATS  
> > > > > more useful.  
> > > > > For one thing, there is no easy way in ATS to initialize array fields  
> > > > > in a safe manner.  
> > > > > While it can be done, it is so involved that I doubt anyone wants to do  
> > > > > it after going  
> > > > > through the trouble once.
> > > > 
> > > > What am I missing here? (this typechecks with the above ‘foo’ type, but  
> > > > does not compile):
> > > > 
> > > > val x: foo = @{field = 1, field2 = “blah”, field3 = @[int]5}
> > > > 
> > > > This looks safe to me; field3 should be an integer array of length 5  
> > > > with each entry initialized to 1?
> > > > 
> > > > > > > 1. If ‘foo2’ can be handled, why require a compiler argument?
> > > > > 
> > > > > To make sure that the user really knows what he is doing.

> > > > > > This seems to raise two questions:
> > > > > > 
> > > > > > 1. Why can’t ‘foo’ be handled?  
> > > > > > It seems to not be an issue of typechecking, as I can make an example  
> > > > > > using ‘foo’ that typechecks. But of course it errors on compilation.
> > > > > > 
> > > > > > 2. If ‘foo2’ can be handled, why require a compiler argument?
> > > > > > 
> > > > > > My guess for this one is that having arrays of arbitrary size can be  
> > > > > > unsafe (without using dependent types for array length), so the default is  
> > > > > > to disallow it. This seems especially dangerous for an unboxed record as it  
> > > > > > might create some issues on the stack?
> > > > > > 
> > > > > > Thanks,

> > > > > > > > > but could you post a short example about the use case for  
> > > > > > > > > -D\_ATS\_ARRAY\_FIELD?
> > > > > > > 
> > > > > > > Say you declare a type foo as follows:
> > > > > > > 
> > > > > > > typedef foo = @{  
> > > > > > > field= int  
> > > > > > > , field2= string  
> > > > > > > , field3= @[int][5] // this cannot be handled  
> > > > > > > }
> > > > > > > 
> > > > > > > ATS will not be able to handle it correctly. Such a type should be  
> > > > > > > given a name in C and then  
> > > > > > > this name can be used in ATS. However, the following type declaration  
> > > > > > > can be handled in ATS:
> > > > > > > 
> > > > > > > typedef foo2 = @{  
> > > > > > > field= int  
> > > > > > > , field2= string  
> > > > > > > , field3= @[int] // this can be handled correctly.
> > > > > > > 
> > > > > > > If you want foo2 to be handled, then you need to have  
> > > > > > > -D\_ATS\_ARRAY\_FIELD when compiling.

> > > > > > > > Is there any way to use $extmcall in C - perhaps if the object is a  
> > > > > > > > struct and one of its fields is a function pointer? Admittedly this is  
> > > > > > > > probably a rare situation, but am just curious.
> > > > > > > > 
> > > > > > > > Sorry for being possibly obtuse once again, but could you post a  
> > > > > > > > short example about the use case for -D\_ATS\_ARRAY\_FIELD?

> > > > > > > > > ---------- Forwarded message ----------  
> > > > > > > > > From: Hongwei Xi [hw...@bu.edu](mailto:hw...@bu.edu)  
> > > > > > > > > Date: Mon, Sep 29, 2014 at 1:37 PM  
> > > > > > > > > Subject: [ats-lang-users] ATS2-0.1.3 released  
> > > > > > > > > To: [ats-l...@lists.sourceforge.net](mailto:ats-l...@lists.sourceforge.net)
> > > > > > > > > 
> > > > > > > > > Hi,
> > > > > > > > > 
> > > > > > > > > I am glad to announce the release of ATS2-0.1.3.
> > > > > > > > > 
> > > > > > > > > The official website for ATS is: [http://www.ats-lang.org](http://www.ats-lang.org)
> > > > > > > > > 
> > > > > > > > > The following packages are included in this release:
> > > > > > > > > 
> > > > > > > > > ATS2-Postiats-0.1.3.tgz  
> > > > > > > > > ATS2-Postiats-include-0.1.3.tgz
> > > > > > > > > 
> > > > > > > > > After installing ATS-Postiats-include, one can compile  
> > > > > > > > > the C code generated from ATS source without installing  
> > > > > > > > > the ATS compiler. So a convenient way to distribute software  
> > > > > > > > > written in ATS is to simply release the C code generated  
> > > > > > > > > from the ATS source.
> > > > > > > > > 
> > > > > > > > > See below for some major additions and changes in ATS2-0.1.3.
> > > > > > > > > 
> > > > > > > > > Cheers!
> > > > > > > > > 
> > > > > > > > > –Hongwei
> > > > > > > > > 
> > > > > > > > > This is the 12th release of ATS2, the successor of the ATS  
> > > > > > > > > programming language. The compiler for ATS2 is given the name  
> > > > > > > > > ATS/Positats, ATS2/Postiats or simply Postiats.
> > > > > > > > > 
> > > > > > > > > The official website for ATS is:
> > > > > > > > > 
> > > > > > > > > [http://www.ats-lang.org](http://www.ats-lang.org)
> > > > > > > > > 
> > > > > > > > > ATS-Postiats is hosted at github:
> > > > > > > > > 
> > > > > > > > > [GitHub - githwxi/ATS-Postiats: ATS2: Unleashing the Potentials of Types and Templates](https://github.com/githwxi/ATS-Postiats)
> > > > > > > > > 
> > > > > > > > > Major releases of ATS2 are available at:
> > > > > > > > > 
> > > > > > > > > [ats2-lang download | SourceForge.net](https://sourceforge.net/projects/ats2-lang/)
> > > > > > > > > 
> > > > > > > > > Major releases of external packages for ATS2 are available at:
> > > > > > > > > 
> > > > > > > > > [ats2-lang-contrib download | SourceForge.net](https://sourceforge.net/projects/ats2-lang-contrib/)
> > > > > > > > > 
> > > > > > > > > Here is a list of major additions and changes since the last  
> > > > > > > > > release:
> > > > > > > > > 
> > > > > > > > > 1. Adding support for dot-notation overloading in assignments.  
> > > > > > > > > This feature is mostly for interacting ATS with other  
> > > > > > > > > languages.  
> > > > > > > > > See ATS2TUTORIAL/CHAP\_DOTOVERLD for a short article of  
> > > > > > > > > explanation.
> > > > > > > > > 2. Adding support for functional style o dot-notation overloading.  
> > > > > > > > > This feature makes it very convenient for ATS to interact with  
> > > > > > > > > OOP.
> > > > > > > > > 3. Generally improving level-2 jsonization (pats\_dynexp2\_jsonize)
> > > > > > > > > 4. Adding support for extvar decl. (which is different from  
> > > > > > > > > $extval):  
> > > > > > > > > extvar “external\_name” = internal\_value
> > > > > > > > > 5. ATS\_DYNLOADFLAG is set to 1 by default only for DATS-files. So  
> > > > > > > > > dynloading SATS-files is no longer necessary (but it is still  
> > > > > > > > > harmless).
> > > > > > > > > 6. Adding support for $extmcall(ret\_type, obj, “method”, arglst),  
> > > > > > > > > which translates into the method invocation: obj.method(arglst)
> > > > > > > > > 7. Adding -D\_ATS\_ARRAY\_FIELD to safe-guard using array fields in  
> > > > > > > > > records.
> > > > > > > > > 
> > > > > > > > > * * *
> > > > > > > > > 
> > > > > > > > > Slashdot TV. Videos for Nerds. Stuff that Matters.
> > > > > > > > > 
> > > > > > > > > [http://pubads.g.doubleclick.net/gampad/clk?id=160591471&iu=/4140/ostg.clktrk](http://pubads.g.doubleclick.net/gampad/clk?id=160591471&iu=/4140/ostg.clktrk)
> > > > > > > > > 
> > > > > > > > > * * *
> > > > > > > > > 
> > > > > > > > > ats-lang-users mailing list  
> > > > > > > > > [ats-l...@lists.sourceforge.net](mailto:ats-l...@lists.sourceforge.net)  
> > > > > > > > > [ats-lang-users List Signup and Options](https://lists.sourceforge.net/lists/listinfo/ats-lang-users)
> > > > > > > > > 
> > > > > > > > > –  
> > > > > > > > > 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](mailto:ats-lang...@googlegroups.com).  
> > > > > > > > > To post to this group, send email to [ats-l...@googlegroups.com](mailto:ats-l...@googlegroups.com).  
> > > > > > > > > Visit this group at [http://groups.google.com/group/ats-lang-users](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/CAPPSPLrXVW-cXge0GccpOjFZf6p3CN5oLggbbaH2LxX-E916uQ%40mail.gmail.com](https://groups.google.com/d/msgid/ats-lang-users/CAPPSPLrXVW-cXge0GccpOjFZf6p3CN5oLggbbaH2LxX-E916uQ%40mail.gmail.com).
> > > > > > > > 
> > > > > > > > –  
> > > > > > > > Brandon Barker  
> > > > > > > > [brand...@gmail.com](mailto:brand...@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...@googlegroups.com](mailto:ats-lang...@googlegroups.com).  
> > > > > > > > To post to this group, send email to [ats-l...@googlegroups.com](mailto:ats-l...@googlegroups.com).  
> > > > > > > > Visit this group at [http://groups.google.com/group/ats-lang-users](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/CAORbNRpHLbLh0OvpqsC\_hyvefX18UMmrtsP6bmcoFrNbGx%2BQjg%40mail.gmail.com](https://groups.google.com/d/msgid/ats-lang-users/CAORbNRpHLbLh0OvpqsC_hyvefX18UMmrtsP6bmcoFrNbGx%2BQjg%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...@googlegroups.com](mailto:ats-lang...@googlegroups.com).  
> > > > > > > To post to this group, send email to [ats-l...@googlegroups.com](mailto:ats-l...@googlegroups.com).  
> > > > > > > Visit this group at [http://groups.google.com/group/ats-lang-users](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/CAPPSPLqfVhhJ8qV5gHDGpnjPuiDu1GPQ2\_p-YbhVPqiFFPR1Lw%40mail.gmail.com](https://groups.google.com/d/msgid/ats-lang-users/CAPPSPLqfVhhJ8qV5gHDGpnjPuiDu1GPQ2_p-YbhVPqiFFPR1Lw%40mail.gmail.com).
> > > > > > 
> > > > > > –  
> > > > > > Brandon Barker  
> > > > > > [brand...@gmail.com](mailto:brand...@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...@googlegroups.com](mailto:ats-lang...@googlegroups.com).  
> > > > > > To post to this group, send email to [ats-l...@googlegroups.com](mailto:ats-l...@googlegroups.com).  
> > > > > > Visit this group at [http://groups.google.com/group/ats-lang-users](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/CAORbNRq-MEq2wZveSGohQyrGEOBL9fLAc3-kbmbZDR-xzOV7Vg%40mail.gmail.com](https://groups.google.com/d/msgid/ats-lang-users/CAORbNRq-MEq2wZveSGohQyrGEOBL9fLAc3-kbmbZDR-xzOV7Vg%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...@googlegroups.com](mailto:ats-lang...@googlegroups.com).  
> > > > > To post to this group, send email to [ats-l...@googlegroups.com](mailto:ats-l...@googlegroups.com).  
> > > > > Visit this group at [http://groups.google.com/group/ats-lang-users](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/CAPPSPLrorB6aMys%3Dqv%3DbackaYe9SaKAZ6Y4gH9Jd2VfG7fT-Vw%40mail.gmail.com](https://groups.google.com/d/msgid/ats-lang-users/CAPPSPLrorB6aMys%3Dqv%3DbackaYe9SaKAZ6Y4gH9Jd2VfG7fT-Vw%40mail.gmail.com).
> > > > 
> > > > –  
> > > > Brandon Barker  
> > > > [brand...@gmail.com](mailto:brand...@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...@googlegroups.com](mailto:ats-lang...@googlegroups.com).  
> > > > To post to this group, send email to [ats-l...@googlegroups.com](mailto:ats-l...@googlegroups.com).  
> > > > Visit this group at [http://groups.google.com/group/ats-lang-users](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/CAORbNRpaPRKr8CxayVKZ6VzjV4cHxVew62DrwDa3wcPdTR75kQ%40mail.gmail.com](https://groups.google.com/d/msgid/ats-lang-users/CAORbNRpaPRKr8CxayVKZ6VzjV4cHxVew62DrwDa3wcPdTR75kQ%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](mailto:ats-lang-user...@googlegroups.com).  
> To post to this group, send email to [ats-lan...@googlegroups.com](mailto:ats-lan...@googlegroups.com).  
> Visit this group at [http://groups.google.com/group/ats-lang-users](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/a937a7d8-de09-4efd-91a6-a5097c614142%40googlegroups.com](https://groups.google.com/d/msgid/ats-lang-users/a937a7d8-de09-4efd-91a6-a5097c614142%40googlegroups.com).

Brandon Barker  
[brandon...@gmail.com](mailto:brandon...@gmail.com)

---

<div class="post-metadata">

**Author:** ![Brandon\_Barker](https://sea1.discourse-cdn.com/flex019/user_avatar/discourse.ats-lang.org/brandon_barker/32/61_2.png) [@Brandon\_Barker](https://discourse.ats-lang.org/u/Brandon_Barker)\
**Post date:** [October 3, 2014, 1:48pm UTC](https://discourse.ats-lang.org/t/ats2-0-1-3-released/600/8 "2014-10-03T13:48:51Z")

</div>

> gmhwxi [gmh...@gmail.com](mailto:gmh...@gmail.com) skribis:
> 
> > > > In a function call, you have a function and some arguments; c0.get  
> > > > should  
> > > > be the  
> > > > function part inside a function call.
> > 
> > In programming languages, the right terminology for this is to say that  
> > c0.get must be  
> > in an _applied_ position.
> 
> IMO this OOPish notation is confusing, but that’s not your fault. 🙂  
> The problem (obvious after some use of Python) is that the thing to  
> the left of the period is an argument, and so has to be thought of as  
> if it were the first thing after the ‘(’.

I actually use python a bit, so this part wasn’t confusing for me, and  
indeed reminded me of python immediately.  
I still think it is convenient - you can  
tab-complete a method name in IPython. But, if you had a functionally  
oriented (or type oriented?) IPython,  
maybe you could tab complete existing object names for a particular  
function.

This seems easier to do in some sense, as it is usually much easier to  
remember a function name and type  
that in than a variable name.

> Still, it might prove useful even for OOP-skeptical me, one day.
> 
> (20 years ago I was OOP-boosting, but now I am OOP-skeptical. 😃 )
> 
> –  
> 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](mailto:ats-lang-user...@googlegroups.com).  
> To post to this group, send email to [ats-lan...@googlegroups.com](mailto:ats-lan...@googlegroups.com).  
> Visit this group at [http://groups.google.com/group/ats-lang-users](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/20141002234730.GA9770%40crud](https://groups.google.com/d/msgid/ats-lang-users/20141002234730.GA9770%40crud)  
> .

Brandon Barker  
[brandon...@gmail.com](mailto:brandon...@gmail.com)

---

<div class="post-metadata">

**Author:** ![gmhwxi](https://avatars.discourse-cdn.com/v4/letter/g/67e7ee/32.png) [@gmhwxi](https://discourse.ats-lang.org/u/gmhwxi)\
**Post date:** [October 2, 2014, 10:38pm UTC](https://discourse.ats-lang.org/t/ats2-0-1-3-released/600/9 "2014-10-02T22:38:51Z")

</div>

In a function call, you have a function and some arguments; c0.get should  
be the  
function part inside a function call.On Thursday, October 2, 2014 4:31:14 PM UTC-4, Brandon Barker wrote:

> Regarding dot-notation overloading for linear values, I can appreciate  
> that the handling might need to be different, but I don’t actually see  
> where the linearity comes in to play. I also don’t really understand the  
> statement: Instead, one needs to use c0.get \*as the function inside a  
> function call \*in order to call counter\_get on c0:
> 
> val n0 = c0.get() // = counter\_get(c0)
> 
> On Mon, Sep 29, 2014 at 1:39 PM, Hongwei Xi \<[gmh...@gmail.com](mailto:gmh...@gmail.com) \<javascript:\>\> wrote:
> 
> > ---------- Forwarded message ----------  
> > From: Hongwei Xi \<hw…@bu.edu \<javascript:\>\>  
> > Date: Mon, Sep 29, 2014 at 1:37 PM  
> > Subject: [ats-lang-users] ATS2-0.1.3 released  
> > To: [ats-l...@lists.sourceforge.net](mailto:ats-l...@lists.sourceforge.net) \<javascript:\>
> > 
> > Hi,
> > 
> > I am glad to announce the release of ATS2-0.1.3.
> > 
> > The official website for ATS is: [http://www.ats-lang.org](http://www.ats-lang.org)
> > 
> > The following packages are included in this release:
> > 
> > ATS2-Postiats-0.1.3.tgz  
> > ATS2-Postiats-include-0.1.3.tgz
> > 
> > After installing ATS-Postiats-include, one can compile  
> > the C code generated from ATS source without installing  
> > the ATS compiler. So a convenient way to distribute software  
> > written in ATS is to simply release the C code generated  
> > from the ATS source.
> > 
> > See below for some major additions and changes in ATS2-0.1.3.
> > 
> > Cheers!
> > 
> > –Hongwei
> > 
> > This is the 12th release of ATS2, the successor of the ATS  
> > programming language. The compiler for ATS2 is given the name  
> > ATS/Positats, ATS2/Postiats or simply Postiats.
> > 
> > The official website for ATS is:
> > 
> > [http://www.ats-lang.org](http://www.ats-lang.org)
> > 
> > ATS-Postiats is hosted at github:
> > 
> > [GitHub - githwxi/ATS-Postiats: ATS2: Unleashing the Potentials of Types and Templates](https://github.com/githwxi/ATS-Postiats)
> > 
> > Major releases of ATS2 are available at:
> > 
> > [ats2-lang download | SourceForge.net](https://sourceforge.net/projects/ats2-lang/)
> > 
> > Major releases of external packages for ATS2 are available at:
> > 
> > [ats2-lang-contrib download | SourceForge.net](https://sourceforge.net/projects/ats2-lang-contrib/)
> > 
> > Here is a list of major additions and changes since the last release:
> > 
> > 1. Adding support for dot-notation overloading in assignments.  
> > This feature is mostly for interacting ATS with other languages.  
> > See ATS2TUTORIAL/CHAP\_DOTOVERLD for a short article of explanation.
> > 2. Adding support for functional style o dot-notation overloading.  
> > This feature makes it very convenient for ATS to interact with OOP.
> > 3. Generally improving level-2 jsonization (pats\_dynexp2\_jsonize)
> > 4. Adding support for extvar decl. (which is different from $extval):  
> > extvar “external\_name” = internal\_value
> > 5. ATS\_DYNLOADFLAG is set to 1 by default only for DATS-files. So  
> > dynloading SATS-files is no longer necessary (but it is still  
> > harmless).
> > 6. Adding support for $extmcall(ret\_type, obj, “method”, arglst),  
> > which translates into the method invocation: obj.method(arglst)
> > 7. Adding -D\_ATS\_ARRAY\_FIELD to safe-guard using array fields in records.
> > 
> > * * *
> > 
> > Slashdot TV. Videos for Nerds. Stuff that Matters.
> > 
> > [http://pubads.g.doubleclick.net/gampad/clk?id=160591471&iu=/4140/ostg.clktrk](http://pubads.g.doubleclick.net/gampad/clk?id=160591471&iu=/4140/ostg.clktrk)
> > 
> > * * *
> > 
> > ats-lang-users mailing list  
> > [ats-l...@lists.sourceforge.net](mailto:ats-l...@lists.sourceforge.net) \<javascript:\>  
> > [ats-lang-users List Signup and Options](https://lists.sourceforge.net/lists/listinfo/ats-lang-users)
> > 
> > –  
> > 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](mailto:ats-lang...@googlegroups.com) \<javascript:\>.  
> > To post to this group, send email to [ats-l...@googlegroups.com](mailto:ats-l...@googlegroups.com)  
> > \<javascript:\>.  
> > Visit this group at [http://groups.google.com/group/ats-lang-users](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/CAPPSPLrXVW-cXge0GccpOjFZf6p3CN5oLggbbaH2LxX-E916uQ%40mail.gmail.com](https://groups.google.com/d/msgid/ats-lang-users/CAPPSPLrXVW-cXge0GccpOjFZf6p3CN5oLggbbaH2LxX-E916uQ%40mail.gmail.com)  
> > [https://groups.google.com/d/msgid/ats-lang-users/CAPPSPLrXVW-cXge0GccpOjFZf6p3CN5oLggbbaH2LxX-E916uQ%40mail.gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/ats-lang-users/CAPPSPLrXVW-cXge0GccpOjFZf6p3CN5oLggbbaH2LxX-E916uQ%40mail.gmail.com?utm_medium=email&utm_source=footer)  
> > .
> 
> –  
> Brandon Barker  
> [brand...@gmail.com](mailto:brand...@gmail.com) \<javascript:\>

---

<div class="post-metadata">

**Author:** ![gmhwxi](https://avatars.discourse-cdn.com/v4/letter/g/67e7ee/32.png) [@gmhwxi](https://discourse.ats-lang.org/u/gmhwxi)\
**Post date:** [October 2, 2014, 11:08pm UTC](https://discourse.ats-lang.org/t/ats2-0-1-3-released/600/10 "2014-10-02T23:08:58Z")

</div>

You can do

foo.x := x0

but you cannot do

foo.x() := x0

The plain dot notation and the functional dot notation have to be handled  
differently.On Thursday, October 2, 2014 7:00:50 PM UTC-4, Brandon Barker wrote:

> It seems like in that case ‘get’ (or ‘get()’) would be the function part  
> of the function all, and c0 would be the rest of it.
> 
> Also, why is it not an issue for nonlinear values; why must linear values  
> require () for their dot-notation overloading? I suspect it may be a not so  
> interesting complexity in the grammar, in which case, I’m happy to stop  
> there :).
> 
> On Thu, Oct 2, 2014 at 6:38 PM, gmhwxi \<[gmh...@gmail.com](mailto:gmh...@gmail.com) \<javascript:\>\> wrote:
> 
> > In a function call, you have a function and some arguments; c0.get should  
> > be the  
> > function part inside a function call.
> > 
> > On Thursday, October 2, 2014 4:31:14 PM UTC-4, Brandon Barker wrote:
> > 
> > > Regarding dot-notation overloading for linear values, I can appreciate  
> > > that the handling might need to be different, but I don’t actually see  
> > > where the linearity comes in to play. I also don’t really understand the  
> > > statement: Instead, one needs to use c0.get \*as the function inside a  
> > > function call \*in order to call counter\_get on c0:
> > > 
> > > val n0 = c0.get() // = counter\_get(c0)
> > > 
> > > On Mon, Sep 29, 2014 at 1:39 PM, Hongwei Xi [gmh...@gmail.com](mailto:gmh...@gmail.com) wrote:
> > > 
> > > > ---------- Forwarded message ----------  
> > > > From: Hongwei Xi [hw...@bu.edu](mailto:hw...@bu.edu)  
> > > > Date: Mon, Sep 29, 2014 at 1:37 PM  
> > > > Subject: [ats-lang-users] ATS2-0.1.3 released  
> > > > To: [ats-l...@lists.sourceforge.net](mailto:ats-l...@lists.sourceforge.net)
> > > > 
> > > > Hi,
> > > > 
> > > > I am glad to announce the release of ATS2-0.1.3.
> > > > 
> > > > The official website for ATS is: [http://www.ats-lang.org](http://www.ats-lang.org)
> > > > 
> > > > The following packages are included in this release:
> > > > 
> > > > ATS2-Postiats-0.1.3.tgz  
> > > > ATS2-Postiats-include-0.1.3.tgz
> > > > 
> > > > After installing ATS-Postiats-include, one can compile  
> > > > the C code generated from ATS source without installing  
> > > > the ATS compiler. So a convenient way to distribute software  
> > > > written in ATS is to simply release the C code generated  
> > > > from the ATS source.
> > > > 
> > > > See below for some major additions and changes in ATS2-0.1.3.
> > > > 
> > > > Cheers!
> > > > 
> > > > –Hongwei
> > > > 
> > > > This is the 12th release of ATS2, the successor of the ATS  
> > > > programming language. The compiler for ATS2 is given the name  
> > > > ATS/Positats, ATS2/Postiats or simply Postiats.
> > > > 
> > > > The official website for ATS is:
> > > > 
> > > > [http://www.ats-lang.org](http://www.ats-lang.org)
> > > > 
> > > > ATS-Postiats is hosted at github:
> > > > 
> > > > [GitHub - githwxi/ATS-Postiats: ATS2: Unleashing the Potentials of Types and Templates](https://github.com/githwxi/ATS-Postiats)
> > > > 
> > > > Major releases of ATS2 are available at:
> > > > 
> > > > [ats2-lang download | SourceForge.net](https://sourceforge.net/projects/ats2-lang/)
> > > > 
> > > > Major releases of external packages for ATS2 are available at:
> > > > 
> > > > [ats2-lang-contrib download | SourceForge.net](https://sourceforge.net/projects/ats2-lang-contrib/)
> > > > 
> > > > Here is a list of major additions and changes since the last release:
> > > > 
> > > > 1. Adding support for dot-notation overloading in assignments.  
> > > > This feature is mostly for interacting ATS with other languages.  
> > > > See ATS2TUTORIAL/CHAP\_DOTOVERLD for a short article of explanation.
> > > > 2. Adding support for functional style o dot-notation overloading.  
> > > > This feature makes it very convenient for ATS to interact with OOP.
> > > > 3. Generally improving level-2 jsonization (pats\_dynexp2\_jsonize)
> > > > 4. Adding support for extvar decl. (which is different from $extval):  
> > > > extvar “external\_name” = internal\_value
> > > > 5. ATS\_DYNLOADFLAG is set to 1 by default only for DATS-files. So  
> > > > dynloading SATS-files is no longer necessary (but it is still  
> > > > harmless).
> > > > 6. Adding support for $extmcall(ret\_type, obj, “method”, arglst),  
> > > > which translates into the method invocation: obj.method(arglst)
> > > > 7. Adding -D\_ATS\_ARRAY\_FIELD to safe-guard using array fields in  
> > > > records.
> > > > 
> > > > * * *
> > > > 
> > > > * * *
> > > > 
> > > > Slashdot TV. Videos for Nerds. Stuff that Matters.  
> > > > [http://pubads.g.doubleclick.net/gampad/clk?id=160591471&](http://pubads.g.doubleclick.net/gampad/clk?id=160591471&)  
> > > > iu=/4140/ostg.clktrk
> > > > 
> > > > * * *
> > > > 
> > > > ats-lang-users mailing list  
> > > > [ats-l...@lists.sourceforge.net](mailto:ats-l...@lists.sourceforge.net)  
> > > > [ats-lang-users List Signup and Options](https://lists.sourceforge.net/lists/listinfo/ats-lang-users)
> > > > 
> > > > –  
> > > > 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](mailto:ats-lang...@googlegroups.com).  
> > > > To post to this group, send email to [ats-l...@googlegroups.com](mailto:ats-l...@googlegroups.com).  
> > > > Visit this group at [http://groups.google.com/group/ats-lang-users](http://groups.google.com/group/ats-lang-users).  
> > > > To view this discussion on the web visit [https://groups.google.com/d/](https://groups.google.com/d/)  
> > > > msgid/ats-lang-users/CAPPSPLrXVW-cXge0GccpOjFZf6p3CN5oLggbbaH2L  
> > > > xX-E916uQ%[40mail.gmail.com](http://40mail.gmail.com)  
> > > > [https://groups.google.com/d/msgid/ats-lang-users/CAPPSPLrXVW-cXge0GccpOjFZf6p3CN5oLggbbaH2LxX-E916uQ%40mail.gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/ats-lang-users/CAPPSPLrXVW-cXge0GccpOjFZf6p3CN5oLggbbaH2LxX-E916uQ%40mail.gmail.com?utm_medium=email&utm_source=footer)  
> > > > .
> > > 
> > > –  
> > > Brandon Barker  
> > > [brand...@gmail.com](mailto:brand...@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...@googlegroups.com](mailto:ats-lang...@googlegroups.com) \<javascript:\>.  
> > To post to this group, send email to [ats-l...@googlegroups.com](mailto:ats-l...@googlegroups.com)  
> > \<javascript:\>.  
> > Visit this group at [http://groups.google.com/group/ats-lang-users](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/79288e34-b6e8-4f4a-80cc-3a7ef3ff23ee%40googlegroups.com](https://groups.google.com/d/msgid/ats-lang-users/79288e34-b6e8-4f4a-80cc-3a7ef3ff23ee%40googlegroups.com)  
> > [https://groups.google.com/d/msgid/ats-lang-users/79288e34-b6e8-4f4a-80cc-3a7ef3ff23ee%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/ats-lang-users/79288e34-b6e8-4f4a-80cc-3a7ef3ff23ee%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > .
> 
> –  
> Brandon Barker  
> [brand...@gmail.com](mailto:brand...@gmail.com) \<javascript:\>

---

<div class="post-metadata">

**Author:** ![gmhwxi](https://avatars.discourse-cdn.com/v4/letter/g/67e7ee/32.png) [@gmhwxi](https://discourse.ats-lang.org/u/gmhwxi)\
**Post date:** [October 3, 2014, 7:12pm UTC](https://discourse.ats-lang.org/t/ats2-0-1-3-released/600/11 "2014-10-03T19:12:22Z")

</div>

Yes, you can use $extmcall in C:

#define ATSextmcall(obj, mtd, funarg) (obj-\>mtd)funarg

It is just not very useful.

One can readily do OOP in C. See [http://www.cs.rit.edu/~ats/books/ooc.pdf](http://www.cs.rit.edu/~ats/books/ooc.pdf)

However, C does not have special syntax for supporting OOP. Take a look at  
GTK.  
Basically, a method call looks like this: method(object, arg\_1, …, arg\_n).

You can actually use the (functional) dot-notation overloading in ATS to  
make these  
calls look like calls in OOP: object.method(arg\_1, …, arg\_n).On Fri, Oct 3, 2014 at 10:04 AM, Brandon Barker [brandon...@gmail.com](mailto:brandon...@gmail.com) wrote:

> Is there any way to use $extmcall in C - perhaps if the object is a struct  
> and one of its fields is a function pointer? Admittedly this is probably a  
> rare situation, but am just curious.
> 
> Sorry for being possibly obtuse once again, but could you post a short  
> example about the use case for -D\_ATS\_ARRAY\_FIELD?
> 
> On Mon, Sep 29, 2014 at 1:39 PM, Hongwei Xi [gmh...@gmail.com](mailto:gmh...@gmail.com) wrote:
> 
> > ---------- Forwarded message ----------  
> > From: Hongwei Xi [hw...@bu.edu](mailto:hw...@bu.edu)  
> > Date: Mon, Sep 29, 2014 at 1:37 PM  
> > Subject: [ats-lang-users] ATS2-0.1.3 released  
> > To: [ats-lan...@lists.sourceforge.net](mailto:ats-lan...@lists.sourceforge.net)
> > 
> > Hi,
> > 
> > I am glad to announce the release of ATS2-0.1.3.
> > 
> > The official website for ATS is: [http://www.ats-lang.org](http://www.ats-lang.org)
> > 
> > The following packages are included in this release:
> > 
> > ATS2-Postiats-0.1.3.tgz  
> > ATS2-Postiats-include-0.1.3.tgz
> > 
> > After installing ATS-Postiats-include, one can compile  
> > the C code generated from ATS source without installing  
> > the ATS compiler. So a convenient way to distribute software  
> > written in ATS is to simply release the C code generated  
> > from the ATS source.
> > 
> > See below for some major additions and changes in ATS2-0.1.3.
> > 
> > Cheers!
> > 
> > –Hongwei
> > 
> > This is the 12th release of ATS2, the successor of the ATS  
> > programming language. The compiler for ATS2 is given the name  
> > ATS/Positats, ATS2/Postiats or simply Postiats.
> > 
> > The official website for ATS is:
> > 
> > [http://www.ats-lang.org](http://www.ats-lang.org)
> > 
> > ATS-Postiats is hosted at github:
> > 
> > [GitHub - githwxi/ATS-Postiats: ATS2: Unleashing the Potentials of Types and Templates](https://github.com/githwxi/ATS-Postiats)
> > 
> > Major releases of ATS2 are available at:
> > 
> > [ats2-lang download | SourceForge.net](https://sourceforge.net/projects/ats2-lang/)
> > 
> > Major releases of external packages for ATS2 are available at:
> > 
> > [ats2-lang-contrib download | SourceForge.net](https://sourceforge.net/projects/ats2-lang-contrib/)
> > 
> > Here is a list of major additions and changes since the last release:
> > 
> > 1. Adding support for dot-notation overloading in assignments.  
> > This feature is mostly for interacting ATS with other languages.  
> > See ATS2TUTORIAL/CHAP\_DOTOVERLD for a short article of explanation.
> > 2. Adding support for functional style o dot-notation overloading.  
> > This feature makes it very convenient for ATS to interact with OOP.
> > 3. Generally improving level-2 jsonization (pats\_dynexp2\_jsonize)
> > 4. Adding support for extvar decl. (which is different from $extval):  
> > extvar “external\_name” = internal\_value
> > 5. ATS\_DYNLOADFLAG is set to 1 by default only for DATS-files. So  
> > dynloading SATS-files is no longer necessary (but it is still  
> > harmless).
> > 6. Adding support for $extmcall(ret\_type, obj, “method”, arglst),  
> > which translates into the method invocation: obj.method(arglst)
> > 7. Adding -D\_ATS\_ARRAY\_FIELD to safe-guard using array fields in records.
> > 
> > * * *
> > 
> > Slashdot TV. Videos for Nerds. Stuff that Matters.
> > 
> > [http://pubads.g.doubleclick.net/gampad/clk?id=160591471&iu=/4140/ostg.clktrk](http://pubads.g.doubleclick.net/gampad/clk?id=160591471&iu=/4140/ostg.clktrk)
> > 
> > * * *
> > 
> > ats-lang-users mailing list  
> > [ats-lan...@lists.sourceforge.net](mailto:ats-lan...@lists.sourceforge.net)  
> > [ats-lang-users List Signup and Options](https://lists.sourceforge.net/lists/listinfo/ats-lang-users)
> > 
> > –  
> > 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](mailto:ats-lang-user...@googlegroups.com).  
> > To post to this group, send email to [ats-lan...@googlegroups.com](mailto:ats-lan...@googlegroups.com).  
> > Visit this group at [http://groups.google.com/group/ats-lang-users](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/CAPPSPLrXVW-cXge0GccpOjFZf6p3CN5oLggbbaH2LxX-E916uQ%40mail.gmail.com](https://groups.google.com/d/msgid/ats-lang-users/CAPPSPLrXVW-cXge0GccpOjFZf6p3CN5oLggbbaH2LxX-E916uQ%40mail.gmail.com)  
> > [https://groups.google.com/d/msgid/ats-lang-users/CAPPSPLrXVW-cXge0GccpOjFZf6p3CN5oLggbbaH2LxX-E916uQ%40mail.gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/ats-lang-users/CAPPSPLrXVW-cXge0GccpOjFZf6p3CN5oLggbbaH2LxX-E916uQ%40mail.gmail.com?utm_medium=email&utm_source=footer)  
> > .
> 
> –  
> Brandon Barker  
> [brandon...@gmail.com](mailto:brandon...@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](mailto:ats-lang-user...@googlegroups.com).  
> To post to this group, send email to [ats-lan...@googlegroups.com](mailto:ats-lan...@googlegroups.com).  
> Visit this group at [http://groups.google.com/group/ats-lang-users](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/CAORbNRpHLbLh0OvpqsC\_hyvefX18UMmrtsP6bmcoFrNbGx%2BQjg%40mail.gmail.com](https://groups.google.com/d/msgid/ats-lang-users/CAORbNRpHLbLh0OvpqsC_hyvefX18UMmrtsP6bmcoFrNbGx%2BQjg%40mail.gmail.com)  
> [https://groups.google.com/d/msgid/ats-lang-users/CAORbNRpHLbLh0OvpqsC\_hyvefX18UMmrtsP6bmcoFrNbGx%2BQjg%40mail.gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/ats-lang-users/CAORbNRpHLbLh0OvpqsC_hyvefX18UMmrtsP6bmcoFrNbGx%2BQjg%40mail.gmail.com?utm_medium=email&utm_source=footer)  
> .

---

<div class="post-metadata">

**Author:** ![gmhwxi](https://avatars.discourse-cdn.com/v4/letter/g/67e7ee/32.png) [@gmhwxi](https://discourse.ats-lang.org/u/gmhwxi)\
**Post date:** [October 3, 2014, 11:54pm UTC](https://discourse.ats-lang.org/t/ats2-0-1-3-released/600/12 "2014-10-03T23:54:32Z")

</div>

It is safe, but where do you store a value like @[int]5?On Fri, Oct 3, 2014 at 6:02 PM, Brandon Barker [brandon...@gmail.com](mailto:brandon...@gmail.com) wrote:

> On Fri, Oct 3, 2014 at 4:44 PM, Hongwei Xi [gmh...@gmail.com](mailto:gmh...@gmail.com) wrote:
> 
> > > > 1. Why can’t ‘foo’ be handled?  
> > > > It seems to not be an issue of typechecking, as I can make an example  
> > > > using ‘foo’ that typechecks. But of course it errors on \>\>compilation.
> > 
> > I would say that being able to handle ‘foo’ does not really make ATS more  
> > useful.  
> > For one thing, there is no easy way in ATS to initialize array fields in  
> > a safe manner.  
> > While it can be done, it is so involved that I doubt anyone wants to do  
> > it after going  
> > through the trouble once.
> 
> What am I missing here? (this typechecks with the above ‘foo’ type, but  
> does not compile):
> 
> val x: foo = @{field = 1, field2 = “blah”, field3 = @[int]5}
> 
> This looks safe to me; field3 should be an integer array of length 5 with  
> each entry initialized to 1?
> 
> > > > 1. If ‘foo2’ can be handled, why require a compiler argument?
> > 
> > To make sure that the user really knows what he is doing.
> > 
> > On Fri, Oct 3, 2014 at 4:27 PM, Brandon Barker [brandon...@gmail.com](mailto:brandon...@gmail.com) wrote:
> > 
> > > This seems to raise two questions:
> > > 
> > > 1. Why can’t ‘foo’ be handled?  
> > > It seems to not be an issue of typechecking, as I can make an example  
> > > using ‘foo’ that typechecks. But of course it errors on compilation.
> > > 
> > > 2. If ‘foo2’ can be handled, why require a compiler argument?
> > > 
> > > My guess for this one is that having arrays of arbitrary size can be  
> > > unsafe (without using dependent types for array length), so the default is  
> > > to disallow it. This seems especially dangerous for an unboxed record as it  
> > > might create some issues on the stack?
> > > 
> > > Thanks,
> > > 
> > > On Fri, Oct 3, 2014 at 3:18 PM, Hongwei Xi [gmh...@gmail.com](mailto:gmh...@gmail.com) wrote:
> > > 
> > > > > > but could you post a short example about the use case for -  
> > > > > > D\_ATS\_ARRAY\_FIELD?
> > > > 
> > > > Say you declare a type foo as follows:
> > > > 
> > > > typedef foo = @{  
> > > > field= int  
> > > > , field2= string  
> > > > , field3= @[int][5] // this cannot be handled  
> > > > }
> > > > 
> > > > ATS will not be able to handle it correctly. Such a type should be  
> > > > given a name in C and then  
> > > > this name can be used in ATS. However, the following type declaration  
> > > > can be handled in ATS:
> > > > 
> > > > typedef foo2 = @{  
> > > > field= int  
> > > > , field2= string  
> > > > , field3= @[int] // this can be handled correctly.
> > > > 
> > > > If you want foo2 to be handled, then you need to have  
> > > > -D\_ATS\_ARRAY\_FIELD when compiling.
> > > > 
> > > > On Fri, Oct 3, 2014 at 10:04 AM, Brandon Barker \< [brandon...@gmail.com](mailto:brandon...@gmail.com)\> wrote:
> > > > 
> > > > > Is there any way to use $extmcall in C - perhaps if the object is a  
> > > > > struct and one of its fields is a function pointer? Admittedly this is  
> > > > > probably a rare situation, but am just curious.
> > > > > 
> > > > > Sorry for being possibly obtuse once again, but could you post a short  
> > > > > example about the use case for -D\_ATS\_ARRAY\_FIELD?
> > > > > 
> > > > > On Mon, Sep 29, 2014 at 1:39 PM, Hongwei Xi [gmh...@gmail.com](mailto:gmh...@gmail.com) wrote:
> > > > > 
> > > > > > ---------- Forwarded message ----------  
> > > > > > From: Hongwei Xi [hw...@bu.edu](mailto:hw...@bu.edu)  
> > > > > > Date: Mon, Sep 29, 2014 at 1:37 PM  
> > > > > > Subject: [ats-lang-users] ATS2-0.1.3 released  
> > > > > > To: [ats-lan...@lists.sourceforge.net](mailto:ats-lan...@lists.sourceforge.net)
> > > > > > 
> > > > > > Hi,
> > > > > > 
> > > > > > I am glad to announce the release of ATS2-0.1.3.
> > > > > > 
> > > > > > The official website for ATS is: [http://www.ats-lang.org](http://www.ats-lang.org)
> > > > > > 
> > > > > > The following packages are included in this release:
> > > > > > 
> > > > > > ATS2-Postiats-0.1.3.tgz  
> > > > > > ATS2-Postiats-include-0.1.3.tgz
> > > > > > 
> > > > > > After installing ATS-Postiats-include, one can compile  
> > > > > > the C code generated from ATS source without installing  
> > > > > > the ATS compiler. So a convenient way to distribute software  
> > > > > > written in ATS is to simply release the C code generated  
> > > > > > from the ATS source.
> > > > > > 
> > > > > > See below for some major additions and changes in ATS2-0.1.3.
> > > > > > 
> > > > > > Cheers!
> > > > > > 
> > > > > > –Hongwei
> > > > > > 
> > > > > > This is the 12th release of ATS2, the successor of the ATS  
> > > > > > programming language. The compiler for ATS2 is given the name  
> > > > > > ATS/Positats, ATS2/Postiats or simply Postiats.
> > > > > > 
> > > > > > The official website for ATS is:
> > > > > > 
> > > > > > [http://www.ats-lang.org](http://www.ats-lang.org)
> > > > > > 
> > > > > > ATS-Postiats is hosted at github:
> > > > > > 
> > > > > > [GitHub - githwxi/ATS-Postiats: ATS2: Unleashing the Potentials of Types and Templates](https://github.com/githwxi/ATS-Postiats)
> > > > > > 
> > > > > > Major releases of ATS2 are available at:
> > > > > > 
> > > > > > [ats2-lang download | SourceForge.net](https://sourceforge.net/projects/ats2-lang/)
> > > > > > 
> > > > > > Major releases of external packages for ATS2 are available at:
> > > > > > 
> > > > > > [ats2-lang-contrib download | SourceForge.net](https://sourceforge.net/projects/ats2-lang-contrib/)
> > > > > > 
> > > > > > Here is a list of major additions and changes since the last release:
> > > > > > 
> > > > > > 1. Adding support for dot-notation overloading in assignments.  
> > > > > > This feature is mostly for interacting ATS with other languages.  
> > > > > > See ATS2TUTORIAL/CHAP\_DOTOVERLD for a short article of  
> > > > > > explanation.
> > > > > > 2. Adding support for functional style o dot-notation overloading.  
> > > > > > This feature makes it very convenient for ATS to interact with  
> > > > > > OOP.
> > > > > > 3. Generally improving level-2 jsonization (pats\_dynexp2\_jsonize)
> > > > > > 4. Adding support for extvar decl. (which is different from $extval):  
> > > > > > extvar “external\_name” = internal\_value
> > > > > > 5. ATS\_DYNLOADFLAG is set to 1 by default only for DATS-files. So  
> > > > > > dynloading SATS-files is no longer necessary (but it is still  
> > > > > > harmless).
> > > > > > 6. Adding support for $extmcall(ret\_type, obj, “method”, arglst),  
> > > > > > which translates into the method invocation: obj.method(arglst)
> > > > > > 7. Adding -D\_ATS\_ARRAY\_FIELD to safe-guard using array fields in  
> > > > > > records.
> > > > > > 
> > > > > > * * *
> > > > > > 
> > > > > > Slashdot TV. Videos for Nerds. Stuff that Matters.
> > > > > > 
> > > > > > [http://pubads.g.doubleclick.net/gampad/clk?id=160591471&iu=/4140/ostg.clktrk](http://pubads.g.doubleclick.net/gampad/clk?id=160591471&iu=/4140/ostg.clktrk)
> > > > > > 
> > > > > > * * *
> > > > > > 
> > > > > > ats-lang-users mailing list  
> > > > > > [ats-lan...@lists.sourceforge.net](mailto:ats-lan...@lists.sourceforge.net)  
> > > > > > [ats-lang-users List Signup and Options](https://lists.sourceforge.net/lists/listinfo/ats-lang-users)
> > > > > > 
> > > > > > –  
> > > > > > 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](mailto:ats-lang-user...@googlegroups.com).  
> > > > > > To post to this group, send email to [ats-lan...@googlegroups.com](mailto:ats-lan...@googlegroups.com).  
> > > > > > Visit this group at [http://groups.google.com/group/ats-lang-users](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/CAPPSPLrXVW-cXge0GccpOjFZf6p3CN5oLggbbaH2LxX-E916uQ%40mail.gmail.com](https://groups.google.com/d/msgid/ats-lang-users/CAPPSPLrXVW-cXge0GccpOjFZf6p3CN5oLggbbaH2LxX-E916uQ%40mail.gmail.com)  
> > > > > > [https://groups.google.com/d/msgid/ats-lang-users/CAPPSPLrXVW-cXge0GccpOjFZf6p3CN5oLggbbaH2LxX-E916uQ%40mail.gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/ats-lang-users/CAPPSPLrXVW-cXge0GccpOjFZf6p3CN5oLggbbaH2LxX-E916uQ%40mail.gmail.com?utm_medium=email&utm_source=footer)  
> > > > > > .
> > > > > 
> > > > > –  
> > > > > Brandon Barker  
> > > > > [brandon...@gmail.com](mailto:brandon...@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](mailto:ats-lang-user...@googlegroups.com).  
> > > > > To post to this group, send email to [ats-lan...@googlegroups.com](mailto:ats-lan...@googlegroups.com).  
> > > > > Visit this group at [http://groups.google.com/group/ats-lang-users](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/CAORbNRpHLbLh0OvpqsC\_hyvefX18UMmrtsP6bmcoFrNbGx%2BQjg%40mail.gmail.com](https://groups.google.com/d/msgid/ats-lang-users/CAORbNRpHLbLh0OvpqsC_hyvefX18UMmrtsP6bmcoFrNbGx%2BQjg%40mail.gmail.com)  
> > > > > [https://groups.google.com/d/msgid/ats-lang-users/CAORbNRpHLbLh0OvpqsC\_hyvefX18UMmrtsP6bmcoFrNbGx%2BQjg%40mail.gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/ats-lang-users/CAORbNRpHLbLh0OvpqsC_hyvefX18UMmrtsP6bmcoFrNbGx%2BQjg%40mail.gmail.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-user...@googlegroups.com](mailto:ats-lang-user...@googlegroups.com).  
> > > > To post to this group, send email to [ats-lan...@googlegroups.com](mailto:ats-lan...@googlegroups.com).  
> > > > Visit this group at [http://groups.google.com/group/ats-lang-users](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/CAPPSPLqfVhhJ8qV5gHDGpnjPuiDu1GPQ2\_p-YbhVPqiFFPR1Lw%40mail.gmail.com](https://groups.google.com/d/msgid/ats-lang-users/CAPPSPLqfVhhJ8qV5gHDGpnjPuiDu1GPQ2_p-YbhVPqiFFPR1Lw%40mail.gmail.com)  
> > > > [https://groups.google.com/d/msgid/ats-lang-users/CAPPSPLqfVhhJ8qV5gHDGpnjPuiDu1GPQ2\_p-YbhVPqiFFPR1Lw%40mail.gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/ats-lang-users/CAPPSPLqfVhhJ8qV5gHDGpnjPuiDu1GPQ2_p-YbhVPqiFFPR1Lw%40mail.gmail.com?utm_medium=email&utm_source=footer)  
> > > > .
> > > 
> > > –  
> > > Brandon Barker  
> > > [brandon...@gmail.com](mailto:brandon...@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](mailto:ats-lang-user...@googlegroups.com).  
> > > To post to this group, send email to [ats-lan...@googlegroups.com](mailto:ats-lan...@googlegroups.com).  
> > > Visit this group at [http://groups.google.com/group/ats-lang-users](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/CAORbNRq-MEq2wZveSGohQyrGEOBL9fLAc3-kbmbZDR-xzOV7Vg%40mail.gmail.com](https://groups.google.com/d/msgid/ats-lang-users/CAORbNRq-MEq2wZveSGohQyrGEOBL9fLAc3-kbmbZDR-xzOV7Vg%40mail.gmail.com)  
> > > [https://groups.google.com/d/msgid/ats-lang-users/CAORbNRq-MEq2wZveSGohQyrGEOBL9fLAc3-kbmbZDR-xzOV7Vg%40mail.gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/ats-lang-users/CAORbNRq-MEq2wZveSGohQyrGEOBL9fLAc3-kbmbZDR-xzOV7Vg%40mail.gmail.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-user...@googlegroups.com](mailto:ats-lang-user...@googlegroups.com).  
> > To post to this group, send email to [ats-lan...@googlegroups.com](mailto:ats-lan...@googlegroups.com).  
> > Visit this group at [http://groups.google.com/group/ats-lang-users](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/CAPPSPLrorB6aMys%3Dqv%3DbackaYe9SaKAZ6Y4gH9Jd2VfG7fT-Vw%40mail.gmail.com](https://groups.google.com/d/msgid/ats-lang-users/CAPPSPLrorB6aMys%3Dqv%3DbackaYe9SaKAZ6Y4gH9Jd2VfG7fT-Vw%40mail.gmail.com)  
> > [https://groups.google.com/d/msgid/ats-lang-users/CAPPSPLrorB6aMys%3Dqv%3DbackaYe9SaKAZ6Y4gH9Jd2VfG7fT-Vw%40mail.gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/ats-lang-users/CAPPSPLrorB6aMys%3Dqv%3DbackaYe9SaKAZ6Y4gH9Jd2VfG7fT-Vw%40mail.gmail.com?utm_medium=email&utm_source=footer)  
> > .
> 
> –  
> Brandon Barker  
> [brandon...@gmail.com](mailto:brandon...@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](mailto:ats-lang-user...@googlegroups.com).  
> To post to this group, send email to [ats-lan...@googlegroups.com](mailto:ats-lan...@googlegroups.com).  
> Visit this group at [http://groups.google.com/group/ats-lang-users](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/CAORbNRpaPRKr8CxayVKZ6VzjV4cHxVew62DrwDa3wcPdTR75kQ%40mail.gmail.com](https://groups.google.com/d/msgid/ats-lang-users/CAORbNRpaPRKr8CxayVKZ6VzjV4cHxVew62DrwDa3wcPdTR75kQ%40mail.gmail.com)  
> [https://groups.google.com/d/msgid/ats-lang-users/CAORbNRpaPRKr8CxayVKZ6VzjV4cHxVew62DrwDa3wcPdTR75kQ%40mail.gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/ats-lang-users/CAORbNRpaPRKr8CxayVKZ6VzjV4cHxVew62DrwDa3wcPdTR75kQ%40mail.gmail.com?utm_medium=email&utm_source=footer)  
> .

---

<div class="post-metadata">

**Author:** ![Brandon\_Barker](https://sea1.discourse-cdn.com/flex019/user_avatar/discourse.ats-lang.org/brandon_barker/32/61_2.png) [@Brandon\_Barker](https://discourse.ats-lang.org/u/Brandon_Barker)\
**Post date:** [October 2, 2014, 8:30pm UTC](https://discourse.ats-lang.org/t/ats2-0-1-3-released/600/13 "2014-10-02T20:30:54Z")

</div>

Regarding dot-notation overloading for linear values, I can appreciate that  
the handling might need to be different, but I don’t actually see where the  
linearity comes in to play. I also don’t really understand the  
statement: Instead,  
one needs to use c0.get \*as the function inside a function call \*in order  
to call counter\_get on c0:

val n0 = c0.get() // = counter\_get(c0)On Mon, Sep 29, 2014 at 1:39 PM, Hongwei Xi [gmh...@gmail.com](mailto:gmh...@gmail.com) wrote:

> ---------- Forwarded message ----------  
> From: Hongwei Xi [hw...@bu.edu](mailto:hw...@bu.edu)  
> Date: Mon, Sep 29, 2014 at 1:37 PM  
> Subject: [ats-lang-users] ATS2-0.1.3 released  
> To: [ats-lan...@lists.sourceforge.net](mailto:ats-lan...@lists.sourceforge.net)
> 
> Hi,
> 
> I am glad to announce the release of ATS2-0.1.3.
> 
> The official website for ATS is: [http://www.ats-lang.org](http://www.ats-lang.org)
> 
> The following packages are included in this release:
> 
> ATS2-Postiats-0.1.3.tgz  
> ATS2-Postiats-include-0.1.3.tgz
> 
> After installing ATS-Postiats-include, one can compile  
> the C code generated from ATS source without installing  
> the ATS compiler. So a convenient way to distribute software  
> written in ATS is to simply release the C code generated  
> from the ATS source.
> 
> See below for some major additions and changes in ATS2-0.1.3.
> 
> Cheers!
> 
> –Hongwei
> 
> This is the 12th release of ATS2, the successor of the ATS  
> programming language. The compiler for ATS2 is given the name  
> ATS/Positats, ATS2/Postiats or simply Postiats.
> 
> The official website for ATS is:
> 
> [http://www.ats-lang.org](http://www.ats-lang.org)
> 
> ATS-Postiats is hosted at github:
> 
> [GitHub - githwxi/ATS-Postiats: ATS2: Unleashing the Potentials of Types and Templates](https://github.com/githwxi/ATS-Postiats)
> 
> Major releases of ATS2 are available at:
> 
> [ats2-lang download | SourceForge.net](https://sourceforge.net/projects/ats2-lang/)
> 
> Major releases of external packages for ATS2 are available at:
> 
> [ats2-lang-contrib download | SourceForge.net](https://sourceforge.net/projects/ats2-lang-contrib/)
> 
> Here is a list of major additions and changes since the last release:
> 
> 1. Adding support for dot-notation overloading in assignments.  
> This feature is mostly for interacting ATS with other languages.  
> See ATS2TUTORIAL/CHAP\_DOTOVERLD for a short article of explanation.
> 2. Adding support for functional style o dot-notation overloading.  
> This feature makes it very convenient for ATS to interact with OOP.
> 3. Generally improving level-2 jsonization (pats\_dynexp2\_jsonize)
> 4. Adding support for extvar decl. (which is different from $extval):  
> extvar “external\_name” = internal\_value
> 5. ATS\_DYNLOADFLAG is set to 1 by default only for DATS-files. So  
> dynloading SATS-files is no longer necessary (but it is still  
> harmless).
> 6. Adding support for $extmcall(ret\_type, obj, “method”, arglst),  
> which translates into the method invocation: obj.method(arglst)
> 7. Adding -D\_ATS\_ARRAY\_FIELD to safe-guard using array fields in records.
> 
> * * *
> 
> Slashdot TV. Videos for Nerds. Stuff that Matters.
> 
> [http://pubads.g.doubleclick.net/gampad/clk?id=160591471&iu=/4140/ostg.clktrk](http://pubads.g.doubleclick.net/gampad/clk?id=160591471&iu=/4140/ostg.clktrk)
> 
> * * *
> 
> ats-lang-users mailing list  
> [ats-lan...@lists.sourceforge.net](mailto:ats-lan...@lists.sourceforge.net)  
> [ats-lang-users List Signup and Options](https://lists.sourceforge.net/lists/listinfo/ats-lang-users)
> 
> –  
> 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](mailto:ats-lang-user...@googlegroups.com).  
> To post to this group, send email to [ats-lan...@googlegroups.com](mailto:ats-lan...@googlegroups.com).  
> Visit this group at [http://groups.google.com/group/ats-lang-users](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/CAPPSPLrXVW-cXge0GccpOjFZf6p3CN5oLggbbaH2LxX-E916uQ%40mail.gmail.com](https://groups.google.com/d/msgid/ats-lang-users/CAPPSPLrXVW-cXge0GccpOjFZf6p3CN5oLggbbaH2LxX-E916uQ%40mail.gmail.com)  
> [https://groups.google.com/d/msgid/ats-lang-users/CAPPSPLrXVW-cXge0GccpOjFZf6p3CN5oLggbbaH2LxX-E916uQ%40mail.gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/ats-lang-users/CAPPSPLrXVW-cXge0GccpOjFZf6p3CN5oLggbbaH2LxX-E916uQ%40mail.gmail.com?utm_medium=email&utm_source=footer)  
> .

Brandon Barker  
[brandon...@gmail.com](mailto:brandon...@gmail.com)

---

<div class="post-metadata">

**Author:** ![Brandon\_Barker](https://sea1.discourse-cdn.com/flex019/user_avatar/discourse.ats-lang.org/brandon_barker/32/61_2.png) [@Brandon\_Barker](https://discourse.ats-lang.org/u/Brandon_Barker)\
**Post date:** [October 3, 2014, 2:04pm UTC](https://discourse.ats-lang.org/t/ats2-0-1-3-released/600/14 "2014-10-03T14:04:27Z")

</div>

Is there any way to use $extmcall in C - perhaps if the object is a struct  
and one of its fields is a function pointer? Admittedly this is probably a  
rare situation, but am just curious.

Sorry for being possibly obtuse once again, but could you post a short  
example about the use case for -D\_ATS\_ARRAY\_FIELD?On Mon, Sep 29, 2014 at 1:39 PM, Hongwei Xi [gmh...@gmail.com](mailto:gmh...@gmail.com) wrote:

> ---------- Forwarded message ----------  
> From: Hongwei Xi [hw...@bu.edu](mailto:hw...@bu.edu)  
> Date: Mon, Sep 29, 2014 at 1:37 PM  
> Subject: [ats-lang-users] ATS2-0.1.3 released  
> To: [ats-lan...@lists.sourceforge.net](mailto:ats-lan...@lists.sourceforge.net)
> 
> Hi,
> 
> I am glad to announce the release of ATS2-0.1.3.
> 
> The official website for ATS is: [http://www.ats-lang.org](http://www.ats-lang.org)
> 
> The following packages are included in this release:
> 
> ATS2-Postiats-0.1.3.tgz  
> ATS2-Postiats-include-0.1.3.tgz
> 
> After installing ATS-Postiats-include, one can compile  
> the C code generated from ATS source without installing  
> the ATS compiler. So a convenient way to distribute software  
> written in ATS is to simply release the C code generated  
> from the ATS source.
> 
> See below for some major additions and changes in ATS2-0.1.3.
> 
> Cheers!
> 
> –Hongwei
> 
> This is the 12th release of ATS2, the successor of the ATS  
> programming language. The compiler for ATS2 is given the name  
> ATS/Positats, ATS2/Postiats or simply Postiats.
> 
> The official website for ATS is:
> 
> [http://www.ats-lang.org](http://www.ats-lang.org)
> 
> ATS-Postiats is hosted at github:
> 
> [GitHub - githwxi/ATS-Postiats: ATS2: Unleashing the Potentials of Types and Templates](https://github.com/githwxi/ATS-Postiats)
> 
> Major releases of ATS2 are available at:
> 
> [ats2-lang download | SourceForge.net](https://sourceforge.net/projects/ats2-lang/)
> 
> Major releases of external packages for ATS2 are available at:
> 
> [ats2-lang-contrib download | SourceForge.net](https://sourceforge.net/projects/ats2-lang-contrib/)
> 
> Here is a list of major additions and changes since the last release:
> 
> 1. Adding support for dot-notation overloading in assignments.  
> This feature is mostly for interacting ATS with other languages.  
> See ATS2TUTORIAL/CHAP\_DOTOVERLD for a short article of explanation.
> 2. Adding support for functional style o dot-notation overloading.  
> This feature makes it very convenient for ATS to interact with OOP.
> 3. Generally improving level-2 jsonization (pats\_dynexp2\_jsonize)
> 4. Adding support for extvar decl. (which is different from $extval):  
> extvar “external\_name” = internal\_value
> 5. ATS\_DYNLOADFLAG is set to 1 by default only for DATS-files. So  
> dynloading SATS-files is no longer necessary (but it is still  
> harmless).
> 6. Adding support for $extmcall(ret\_type, obj, “method”, arglst),  
> which translates into the method invocation: obj.method(arglst)
> 7. Adding -D\_ATS\_ARRAY\_FIELD to safe-guard using array fields in records.
> 
> * * *
> 
> Slashdot TV. Videos for Nerds. Stuff that Matters.
> 
> [http://pubads.g.doubleclick.net/gampad/clk?id=160591471&iu=/4140/ostg.clktrk](http://pubads.g.doubleclick.net/gampad/clk?id=160591471&iu=/4140/ostg.clktrk)
> 
> * * *
> 
> ats-lang-users mailing list  
> [ats-lan...@lists.sourceforge.net](mailto:ats-lan...@lists.sourceforge.net)  
> [ats-lang-users List Signup and Options](https://lists.sourceforge.net/lists/listinfo/ats-lang-users)
> 
> –  
> 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](mailto:ats-lang-user...@googlegroups.com).  
> To post to this group, send email to [ats-lan...@googlegroups.com](mailto:ats-lan...@googlegroups.com).  
> Visit this group at [http://groups.google.com/group/ats-lang-users](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/CAPPSPLrXVW-cXge0GccpOjFZf6p3CN5oLggbbaH2LxX-E916uQ%40mail.gmail.com](https://groups.google.com/d/msgid/ats-lang-users/CAPPSPLrXVW-cXge0GccpOjFZf6p3CN5oLggbbaH2LxX-E916uQ%40mail.gmail.com)  
> [https://groups.google.com/d/msgid/ats-lang-users/CAPPSPLrXVW-cXge0GccpOjFZf6p3CN5oLggbbaH2LxX-E916uQ%40mail.gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/ats-lang-users/CAPPSPLrXVW-cXge0GccpOjFZf6p3CN5oLggbbaH2LxX-E916uQ%40mail.gmail.com?utm_medium=email&utm_source=footer)  
> .

Brandon Barker  
[brandon...@gmail.com](mailto:brandon...@gmail.com)

---

<div class="post-metadata">

**Author:** ![Brandon\_Barker](https://sea1.discourse-cdn.com/flex019/user_avatar/discourse.ats-lang.org/brandon_barker/32/61_2.png) [@Brandon\_Barker](https://discourse.ats-lang.org/u/Brandon_Barker)\
**Post date:** [October 3, 2014, 8:27pm UTC](https://discourse.ats-lang.org/t/ats2-0-1-3-released/600/15 "2014-10-03T20:27:59Z")

</div>

This seems to raise two questions:

1. Why can’t ‘foo’ be handled?  
It seems to not be an issue of typechecking, as I can make an example using  
‘foo’ that typechecks. But of course it errors on compilation.

2. If ‘foo2’ can be handled, why require a compiler argument?

My guess for this one is that having arrays of arbitrary size can be unsafe  
(without using dependent types for array length), so the default is to  
disallow it. This seems especially dangerous for an unboxed record as it  
might create some issues on the stack?

Thanks,On Fri, Oct 3, 2014 at 3:18 PM, Hongwei Xi [gmh...@gmail.com](mailto:gmh...@gmail.com) wrote:

> > > but could you post a short example about the use case for -  
> > > D\_ATS\_ARRAY\_FIELD?
> 
> Say you declare a type foo as follows:
> 
> typedef foo = @{  
> field= int  
> , field2= string  
> , field3= @[int][5] // this cannot be handled  
> }
> 
> ATS will not be able to handle it correctly. Such a type should be given a  
> name in C and then  
> this name can be used in ATS. However, the following type declaration can  
> be handled in ATS:
> 
> typedef foo2 = @{  
> field= int  
> , field2= string  
> , field3= @[int] // this can be handled correctly.
> 
> If you want foo2 to be handled, then you need to have -D\_ATS\_ARRAY\_FIELD  
> when compiling.
> 
> On Fri, Oct 3, 2014 at 10:04 AM, Brandon Barker [brandon...@gmail.com](mailto:brandon...@gmail.com) wrote:
> 
> > Is there any way to use $extmcall in C - perhaps if the object is a  
> > struct and one of its fields is a function pointer? Admittedly this is  
> > probably a rare situation, but am just curious.
> > 
> > Sorry for being possibly obtuse once again, but could you post a short  
> > example about the use case for -D\_ATS\_ARRAY\_FIELD?
> > 
> > On Mon, Sep 29, 2014 at 1:39 PM, Hongwei Xi [gmh...@gmail.com](mailto:gmh...@gmail.com) wrote:
> > 
> > > ---------- Forwarded message ----------  
> > > From: Hongwei Xi [hw...@bu.edu](mailto:hw...@bu.edu)  
> > > Date: Mon, Sep 29, 2014 at 1:37 PM  
> > > Subject: [ats-lang-users] ATS2-0.1.3 released  
> > > To: [ats-lan...@lists.sourceforge.net](mailto:ats-lan...@lists.sourceforge.net)
> > > 
> > > Hi,
> > > 
> > > I am glad to announce the release of ATS2-0.1.3.
> > > 
> > > The official website for ATS is: [http://www.ats-lang.org](http://www.ats-lang.org)
> > > 
> > > The following packages are included in this release:
> > > 
> > > ATS2-Postiats-0.1.3.tgz  
> > > ATS2-Postiats-include-0.1.3.tgz
> > > 
> > > After installing ATS-Postiats-include, one can compile  
> > > the C code generated from ATS source without installing  
> > > the ATS compiler. So a convenient way to distribute software  
> > > written in ATS is to simply release the C code generated  
> > > from the ATS source.
> > > 
> > > See below for some major additions and changes in ATS2-0.1.3.
> > > 
> > > Cheers!
> > > 
> > > –Hongwei
> > > 
> > > This is the 12th release of ATS2, the successor of the ATS  
> > > programming language. The compiler for ATS2 is given the name  
> > > ATS/Positats, ATS2/Postiats or simply Postiats.
> > > 
> > > The official website for ATS is:
> > > 
> > > [http://www.ats-lang.org](http://www.ats-lang.org)
> > > 
> > > ATS-Postiats is hosted at github:
> > > 
> > > [GitHub - githwxi/ATS-Postiats: ATS2: Unleashing the Potentials of Types and Templates](https://github.com/githwxi/ATS-Postiats)
> > > 
> > > Major releases of ATS2 are available at:
> > > 
> > > [ats2-lang download | SourceForge.net](https://sourceforge.net/projects/ats2-lang/)
> > > 
> > > Major releases of external packages for ATS2 are available at:
> > > 
> > > [ats2-lang-contrib download | SourceForge.net](https://sourceforge.net/projects/ats2-lang-contrib/)
> > > 
> > > Here is a list of major additions and changes since the last release:
> > > 
> > > 1. Adding support for dot-notation overloading in assignments.  
> > > This feature is mostly for interacting ATS with other languages.  
> > > See ATS2TUTORIAL/CHAP\_DOTOVERLD for a short article of explanation.
> > > 2. Adding support for functional style o dot-notation overloading.  
> > > This feature makes it very convenient for ATS to interact with OOP.
> > > 3. Generally improving level-2 jsonization (pats\_dynexp2\_jsonize)
> > > 4. Adding support for extvar decl. (which is different from $extval):  
> > > extvar “external\_name” = internal\_value
> > > 5. ATS\_DYNLOADFLAG is set to 1 by default only for DATS-files. So  
> > > dynloading SATS-files is no longer necessary (but it is still  
> > > harmless).
> > > 6. Adding support for $extmcall(ret\_type, obj, “method”, arglst),  
> > > which translates into the method invocation: obj.method(arglst)
> > > 7. Adding -D\_ATS\_ARRAY\_FIELD to safe-guard using array fields in records.
> > > 
> > > * * *
> > > 
> > > Slashdot TV. Videos for Nerds. Stuff that Matters.
> > > 
> > > [http://pubads.g.doubleclick.net/gampad/clk?id=160591471&iu=/4140/ostg.clktrk](http://pubads.g.doubleclick.net/gampad/clk?id=160591471&iu=/4140/ostg.clktrk)
> > > 
> > > * * *
> > > 
> > > ats-lang-users mailing list  
> > > [ats-lan...@lists.sourceforge.net](mailto:ats-lan...@lists.sourceforge.net)  
> > > [ats-lang-users List Signup and Options](https://lists.sourceforge.net/lists/listinfo/ats-lang-users)
> > > 
> > > –  
> > > 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](mailto:ats-lang-user...@googlegroups.com).  
> > > To post to this group, send email to [ats-lan...@googlegroups.com](mailto:ats-lan...@googlegroups.com).  
> > > Visit this group at [http://groups.google.com/group/ats-lang-users](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/CAPPSPLrXVW-cXge0GccpOjFZf6p3CN5oLggbbaH2LxX-E916uQ%40mail.gmail.com](https://groups.google.com/d/msgid/ats-lang-users/CAPPSPLrXVW-cXge0GccpOjFZf6p3CN5oLggbbaH2LxX-E916uQ%40mail.gmail.com)  
> > > [https://groups.google.com/d/msgid/ats-lang-users/CAPPSPLrXVW-cXge0GccpOjFZf6p3CN5oLggbbaH2LxX-E916uQ%40mail.gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/ats-lang-users/CAPPSPLrXVW-cXge0GccpOjFZf6p3CN5oLggbbaH2LxX-E916uQ%40mail.gmail.com?utm_medium=email&utm_source=footer)  
> > > .
> > 
> > –  
> > Brandon Barker  
> > [brandon...@gmail.com](mailto:brandon...@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](mailto:ats-lang-user...@googlegroups.com).  
> > To post to this group, send email to [ats-lan...@googlegroups.com](mailto:ats-lan...@googlegroups.com).  
> > Visit this group at [http://groups.google.com/group/ats-lang-users](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/CAORbNRpHLbLh0OvpqsC\_hyvefX18UMmrtsP6bmcoFrNbGx%2BQjg%40mail.gmail.com](https://groups.google.com/d/msgid/ats-lang-users/CAORbNRpHLbLh0OvpqsC_hyvefX18UMmrtsP6bmcoFrNbGx%2BQjg%40mail.gmail.com)  
> > [https://groups.google.com/d/msgid/ats-lang-users/CAORbNRpHLbLh0OvpqsC\_hyvefX18UMmrtsP6bmcoFrNbGx%2BQjg%40mail.gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/ats-lang-users/CAORbNRpHLbLh0OvpqsC_hyvefX18UMmrtsP6bmcoFrNbGx%2BQjg%40mail.gmail.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-user...@googlegroups.com](mailto:ats-lang-user...@googlegroups.com).  
> To post to this group, send email to [ats-lan...@googlegroups.com](mailto:ats-lan...@googlegroups.com).  
> Visit this group at [http://groups.google.com/group/ats-lang-users](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/CAPPSPLqfVhhJ8qV5gHDGpnjPuiDu1GPQ2\_p-YbhVPqiFFPR1Lw%40mail.gmail.com](https://groups.google.com/d/msgid/ats-lang-users/CAPPSPLqfVhhJ8qV5gHDGpnjPuiDu1GPQ2_p-YbhVPqiFFPR1Lw%40mail.gmail.com)  
> [https://groups.google.com/d/msgid/ats-lang-users/CAPPSPLqfVhhJ8qV5gHDGpnjPuiDu1GPQ2\_p-YbhVPqiFFPR1Lw%40mail.gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/ats-lang-users/CAPPSPLqfVhhJ8qV5gHDGpnjPuiDu1GPQ2_p-YbhVPqiFFPR1Lw%40mail.gmail.com?utm_medium=email&utm_source=footer)  
> .

Brandon Barker  
[brandon...@gmail.com](mailto:brandon...@gmail.com)

---

<div class="post-metadata">

**Author:** ![Brandon\_Barker](https://sea1.discourse-cdn.com/flex019/user_avatar/discourse.ats-lang.org/brandon_barker/32/61_2.png) [@Brandon\_Barker](https://discourse.ats-lang.org/u/Brandon_Barker)\
**Post date:** [October 4, 2014, 10:33pm UTC](https://discourse.ats-lang.org/t/ats2-0-1-3-released/600/16 "2014-10-04T22:33:23Z")

</div>

I thought this implied it was stack allocated. I also thought that record  
types starting with ‘@’ are stack allocated unless explicitly put on the  
heap (just like a struct in c), so it would seem these would be compatible.

But something does seem off. I actually thought

val x = …

implied stack allocation by default, unless some function using malloc is  
employed or a nonlinear type is used. While, both of these typecheck, only  
the latter compiles:

val my\_array = @[int]5

var my\_array = @[int]5

What am I missing/forgetting in this case?

Thanks,On Friday, October 3, 2014 7:54:33 PM UTC-4, gmhwxi wrote:

> It is safe, but where do you store a value like @[int]5?
> 
> On Fri, Oct 3, 2014 at 6:02 PM, Brandon Barker \<[brand...@gmail.com](mailto:brand...@gmail.com) \<javascript:\>\> wrote:
> 
> > On Fri, Oct 3, 2014 at 4:44 PM, Hongwei Xi \<[gmh...@gmail.com](mailto:gmh...@gmail.com) \<javascript:\>\> wrote:
> > 
> > > > > 1. Why can’t ‘foo’ be handled?  
> > > > > It seems to not be an issue of typechecking, as I can make an example  
> > > > > using ‘foo’ that typechecks. But of course it errors on \>\>compilation.
> > > 
> > > I would say that being able to handle ‘foo’ does not really make ATS  
> > > more useful.  
> > > For one thing, there is no easy way in ATS to initialize array fields in  
> > > a safe manner.  
> > > While it can be done, it is so involved that I doubt anyone wants to do  
> > > it after going  
> > > through the trouble once.
> > 
> > What am I missing here? (this typechecks with the above ‘foo’ type, but  
> > does not compile):
> > 
> > val x: foo = @{field = 1, field2 = “blah”, field3 = @[int]5}
> > 
> > This looks safe to me; field3 should be an integer array of length 5 with  
> > each entry initialized to 1?
> > 
> > > > > 1. If ‘foo2’ can be handled, why require a compiler argument?
> > > 
> > > To make sure that the user really knows what he is doing.
> > > 
> > > On Fri, Oct 3, 2014 at 4:27 PM, Brandon Barker \<[brand...@gmail.com](mailto:brand...@gmail.com) \<javascript:\>\> wrote:
> > > 
> > > > This seems to raise two questions:
> > > > 
> > > > 1. Why can’t ‘foo’ be handled?  
> > > > It seems to not be an issue of typechecking, as I can make an example  
> > > > using ‘foo’ that typechecks. But of course it errors on compilation.
> > > > 
> > > > 2. If ‘foo2’ can be handled, why require a compiler argument?
> > > > 
> > > > My guess for this one is that having arrays of arbitrary size can be  
> > > > unsafe (without using dependent types for array length), so the default is  
> > > > to disallow it. This seems especially dangerous for an unboxed record as it  
> > > > might create some issues on the stack?
> > > > 
> > > > Thanks,
> > > > 
> > > > On Fri, Oct 3, 2014 at 3:18 PM, Hongwei Xi \<[gmh...@gmail.com](mailto:gmh...@gmail.com) \<javascript:\>\> wrote:
> > > > 
> > > > > > > but could you post a short example about the use case for -  
> > > > > > > D\_ATS\_ARRAY\_FIELD?
> > > > > 
> > > > > Say you declare a type foo as follows:
> > > > > 
> > > > > typedef foo = @{  
> > > > > field= int  
> > > > > , field2= string  
> > > > > , field3= @[int][5] // this cannot be handled  
> > > > > }
> > > > > 
> > > > > ATS will not be able to handle it correctly. Such a type should be  
> > > > > given a name in C and then  
> > > > > this name can be used in ATS. However, the following type declaration  
> > > > > can be handled in ATS:
> > > > > 
> > > > > typedef foo2 = @{  
> > > > > field= int  
> > > > > , field2= string  
> > > > > , field3= @[int] // this can be handled correctly.
> > > > > 
> > > > > If you want foo2 to be handled, then you need to have  
> > > > > -D\_ATS\_ARRAY\_FIELD when compiling.
> > > > > 
> > > > > On Fri, Oct 3, 2014 at 10:04 AM, Brandon Barker \<[brand...@gmail.com](mailto:brand...@gmail.com) \<javascript:\>\> wrote:
> > > > > 
> > > > > > Is there any way to use $extmcall in C - perhaps if the object is a  
> > > > > > struct and one of its fields is a function pointer? Admittedly this is  
> > > > > > probably a rare situation, but am just curious.
> > > > > > 
> > > > > > Sorry for being possibly obtuse once again, but could you post a  
> > > > > > short example about the use case for -D\_ATS\_ARRAY\_FIELD?
> > > > > > 
> > > > > > On Mon, Sep 29, 2014 at 1:39 PM, Hongwei Xi \<[gmh...@gmail.com](mailto:gmh...@gmail.com) \<javascript:\>\> wrote:
> > > > > > 
> > > > > > > ---------- Forwarded message ----------  
> > > > > > > From: Hongwei Xi \<hw…@bu.edu \<javascript:\>\>  
> > > > > > > Date: Mon, Sep 29, 2014 at 1:37 PM  
> > > > > > > Subject: [ats-lang-users] ATS2-0.1.3 released  
> > > > > > > To: [ats-l...@lists.sourceforge.net](mailto:ats-l...@lists.sourceforge.net) \<javascript:\>
> > > > > > > 
> > > > > > > Hi,
> > > > > > > 
> > > > > > > I am glad to announce the release of ATS2-0.1.3.
> > > > > > > 
> > > > > > > The official website for ATS is: [http://www.ats-lang.org](http://www.ats-lang.org)
> > > > > > > 
> > > > > > > The following packages are included in this release:
> > > > > > > 
> > > > > > > ATS2-Postiats-0.1.3.tgz  
> > > > > > > ATS2-Postiats-include-0.1.3.tgz
> > > > > > > 
> > > > > > > After installing ATS-Postiats-include, one can compile  
> > > > > > > the C code generated from ATS source without installing  
> > > > > > > the ATS compiler. So a convenient way to distribute software  
> > > > > > > written in ATS is to simply release the C code generated  
> > > > > > > from the ATS source.
> > > > > > > 
> > > > > > > See below for some major additions and changes in ATS2-0.1.3.
> > > > > > > 
> > > > > > > Cheers!
> > > > > > > 
> > > > > > > –Hongwei
> > > > > > > 
> > > > > > > This is the 12th release of ATS2, the successor of the ATS  
> > > > > > > programming language. The compiler for ATS2 is given the name  
> > > > > > > ATS/Positats, ATS2/Postiats or simply Postiats.
> > > > > > > 
> > > > > > > The official website for ATS is:
> > > > > > > 
> > > > > > > [http://www.ats-lang.org](http://www.ats-lang.org)
> > > > > > > 
> > > > > > > ATS-Postiats is hosted at github:
> > > > > > > 
> > > > > > > [GitHub - githwxi/ATS-Postiats: ATS2: Unleashing the Potentials of Types and Templates](https://github.com/githwxi/ATS-Postiats)
> > > > > > > 
> > > > > > > Major releases of ATS2 are available at:
> > > > > > > 
> > > > > > > [ats2-lang download | SourceForge.net](https://sourceforge.net/projects/ats2-lang/)
> > > > > > > 
> > > > > > > Major releases of external packages for ATS2 are available at:
> > > > > > > 
> > > > > > > [ats2-lang-contrib download | SourceForge.net](https://sourceforge.net/projects/ats2-lang-contrib/)
> > > > > > > 
> > > > > > > Here is a list of major additions and changes since the last release:
> > > > > > > 
> > > > > > > 1. Adding support for dot-notation overloading in assignments.  
> > > > > > > This feature is mostly for interacting ATS with other languages.  
> > > > > > > See ATS2TUTORIAL/CHAP\_DOTOVERLD for a short article of  
> > > > > > > explanation.
> > > > > > > 2. Adding support for functional style o dot-notation overloading.  
> > > > > > > This feature makes it very convenient for ATS to interact with  
> > > > > > > OOP.
> > > > > > > 3. Generally improving level-2 jsonization (pats\_dynexp2\_jsonize)
> > > > > > > 4. Adding support for extvar decl. (which is different from $extval):  
> > > > > > > extvar “external\_name” = internal\_value
> > > > > > > 5. ATS\_DYNLOADFLAG is set to 1 by default only for DATS-files. So  
> > > > > > > dynloading SATS-files is no longer necessary (but it is still  
> > > > > > > harmless).
> > > > > > > 6. Adding support for $extmcall(ret\_type, obj, “method”, arglst),  
> > > > > > > which translates into the method invocation: obj.method(arglst)
> > > > > > > 7. Adding -D\_ATS\_ARRAY\_FIELD to safe-guard using array fields in  
> > > > > > > records.
> > > > > > > 
> > > > > > > * * *
> > > > > > > 
> > > > > > > Slashdot TV. Videos for Nerds. Stuff that Matters.
> > > > > > > 
> > > > > > > [http://pubads.g.doubleclick.net/gampad/clk?id=160591471&iu=/4140/ostg.clktrk](http://pubads.g.doubleclick.net/gampad/clk?id=160591471&iu=/4140/ostg.clktrk)
> > > > > > > 
> > > > > > > * * *
> > > > > > > 
> > > > > > > ats-lang-users mailing list  
> > > > > > > [ats-l...@lists.sourceforge.net](mailto:ats-l...@lists.sourceforge.net) \<javascript:\>  
> > > > > > > [ats-lang-users List Signup and Options](https://lists.sourceforge.net/lists/listinfo/ats-lang-users)
> > > > > > > 
> > > > > > > –  
> > > > > > > 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](mailto:ats-lang...@googlegroups.com) \<javascript:\>.  
> > > > > > > To post to this group, send email to [ats-l...@googlegroups.com](mailto:ats-l...@googlegroups.com)  
> > > > > > > \<javascript:\>.  
> > > > > > > Visit this group at [http://groups.google.com/group/ats-lang-users](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/CAPPSPLrXVW-cXge0GccpOjFZf6p3CN5oLggbbaH2LxX-E916uQ%40mail.gmail.com](https://groups.google.com/d/msgid/ats-lang-users/CAPPSPLrXVW-cXge0GccpOjFZf6p3CN5oLggbbaH2LxX-E916uQ%40mail.gmail.com)  
> > > > > > > [https://groups.google.com/d/msgid/ats-lang-users/CAPPSPLrXVW-cXge0GccpOjFZf6p3CN5oLggbbaH2LxX-E916uQ%40mail.gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/ats-lang-users/CAPPSPLrXVW-cXge0GccpOjFZf6p3CN5oLggbbaH2LxX-E916uQ%40mail.gmail.com?utm_medium=email&utm_source=footer)  
> > > > > > > .
> > > > > > 
> > > > > > –  
> > > > > > Brandon Barker  
> > > > > > [brand...@gmail.com](mailto:brand...@gmail.com) \<javascript:\>
> > > > > > 
> > > > > > –  
> > > > > > 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](mailto:ats-lang...@googlegroups.com) \<javascript:\>.  
> > > > > > To post to this group, send email to [ats-l...@googlegroups.com](mailto:ats-l...@googlegroups.com)  
> > > > > > \<javascript:\>.  
> > > > > > Visit this group at [http://groups.google.com/group/ats-lang-users](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/CAORbNRpHLbLh0OvpqsC\_hyvefX18UMmrtsP6bmcoFrNbGx%2BQjg%40mail.gmail.com](https://groups.google.com/d/msgid/ats-lang-users/CAORbNRpHLbLh0OvpqsC_hyvefX18UMmrtsP6bmcoFrNbGx%2BQjg%40mail.gmail.com)  
> > > > > > [https://groups.google.com/d/msgid/ats-lang-users/CAORbNRpHLbLh0OvpqsC\_hyvefX18UMmrtsP6bmcoFrNbGx%2BQjg%40mail.gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/ats-lang-users/CAORbNRpHLbLh0OvpqsC_hyvefX18UMmrtsP6bmcoFrNbGx%2BQjg%40mail.gmail.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...@googlegroups.com](mailto:ats-lang...@googlegroups.com) \<javascript:\>.  
> > > > > To post to this group, send email to [ats-l...@googlegroups.com](mailto:ats-l...@googlegroups.com)  
> > > > > \<javascript:\>.  
> > > > > Visit this group at [http://groups.google.com/group/ats-lang-users](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/CAPPSPLqfVhhJ8qV5gHDGpnjPuiDu1GPQ2\_p-YbhVPqiFFPR1Lw%40mail.gmail.com](https://groups.google.com/d/msgid/ats-lang-users/CAPPSPLqfVhhJ8qV5gHDGpnjPuiDu1GPQ2_p-YbhVPqiFFPR1Lw%40mail.gmail.com)  
> > > > > [https://groups.google.com/d/msgid/ats-lang-users/CAPPSPLqfVhhJ8qV5gHDGpnjPuiDu1GPQ2\_p-YbhVPqiFFPR1Lw%40mail.gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/ats-lang-users/CAPPSPLqfVhhJ8qV5gHDGpnjPuiDu1GPQ2_p-YbhVPqiFFPR1Lw%40mail.gmail.com?utm_medium=email&utm_source=footer)  
> > > > > .
> > > > 
> > > > –  
> > > > Brandon Barker  
> > > > [brand...@gmail.com](mailto:brand...@gmail.com) \<javascript:\>
> > > > 
> > > > –  
> > > > 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](mailto:ats-lang...@googlegroups.com) \<javascript:\>.  
> > > > To post to this group, send email to [ats-l...@googlegroups.com](mailto:ats-l...@googlegroups.com)  
> > > > \<javascript:\>.  
> > > > Visit this group at [http://groups.google.com/group/ats-lang-users](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/CAORbNRq-MEq2wZveSGohQyrGEOBL9fLAc3-kbmbZDR-xzOV7Vg%40mail.gmail.com](https://groups.google.com/d/msgid/ats-lang-users/CAORbNRq-MEq2wZveSGohQyrGEOBL9fLAc3-kbmbZDR-xzOV7Vg%40mail.gmail.com)  
> > > > [https://groups.google.com/d/msgid/ats-lang-users/CAORbNRq-MEq2wZveSGohQyrGEOBL9fLAc3-kbmbZDR-xzOV7Vg%40mail.gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/ats-lang-users/CAORbNRq-MEq2wZveSGohQyrGEOBL9fLAc3-kbmbZDR-xzOV7Vg%40mail.gmail.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...@googlegroups.com](mailto:ats-lang...@googlegroups.com) \<javascript:\>.  
> > > To post to this group, send email to [ats-l...@googlegroups.com](mailto:ats-l...@googlegroups.com)  
> > > \<javascript:\>.  
> > > Visit this group at [http://groups.google.com/group/ats-lang-users](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/CAPPSPLrorB6aMys%3Dqv%3DbackaYe9SaKAZ6Y4gH9Jd2VfG7fT-Vw%40mail.gmail.com](https://groups.google.com/d/msgid/ats-lang-users/CAPPSPLrorB6aMys%3Dqv%3DbackaYe9SaKAZ6Y4gH9Jd2VfG7fT-Vw%40mail.gmail.com)  
> > > [https://groups.google.com/d/msgid/ats-lang-users/CAPPSPLrorB6aMys%3Dqv%3DbackaYe9SaKAZ6Y4gH9Jd2VfG7fT-Vw%40mail.gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/ats-lang-users/CAPPSPLrorB6aMys%3Dqv%3DbackaYe9SaKAZ6Y4gH9Jd2VfG7fT-Vw%40mail.gmail.com?utm_medium=email&utm_source=footer)  
> > > .
> > 
> > –  
> > Brandon Barker  
> > [brand...@gmail.com](mailto:brand...@gmail.com) \<javascript:\>
> > 
> > –  
> > 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](mailto:ats-lang...@googlegroups.com) \<javascript:\>.  
> > To post to this group, send email to [ats-l...@googlegroups.com](mailto:ats-l...@googlegroups.com)  
> > \<javascript:\>.  
> > Visit this group at [http://groups.google.com/group/ats-lang-users](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/CAORbNRpaPRKr8CxayVKZ6VzjV4cHxVew62DrwDa3wcPdTR75kQ%40mail.gmail.com](https://groups.google.com/d/msgid/ats-lang-users/CAORbNRpaPRKr8CxayVKZ6VzjV4cHxVew62DrwDa3wcPdTR75kQ%40mail.gmail.com)  
> > [https://groups.google.com/d/msgid/ats-lang-users/CAORbNRpaPRKr8CxayVKZ6VzjV4cHxVew62DrwDa3wcPdTR75kQ%40mail.gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/ats-lang-users/CAORbNRpaPRKr8CxayVKZ6VzjV4cHxVew62DrwDa3wcPdTR75kQ%40mail.gmail.com?utm_medium=email&utm_source=footer)  
> > .

---

<div class="post-metadata">

**Author:** ![Brandon\_Barker](https://sea1.discourse-cdn.com/flex019/user_avatar/discourse.ats-lang.org/brandon_barker/32/61_2.png) [@Brandon\_Barker](https://discourse.ats-lang.org/u/Brandon_Barker)\
**Post date:** [October 3, 2014, 10:02pm UTC](https://discourse.ats-lang.org/t/ats2-0-1-3-released/600/17 "2014-10-03T22:02:08Z")

</div>

> > > 1. Why can’t ‘foo’ be handled?  
> > > It seems to not be an issue of typechecking, as I can make an example  
> > > using ‘foo’ that typechecks. But of course it errors on \>\>compilation.
> 
> I would say that being able to handle ‘foo’ does not really make ATS more  
> useful.  
> For one thing, there is no easy way in ATS to initialize array fields in a  
> safe manner.  
> While it can be done, it is so involved that I doubt anyone wants to do it  
> after going  
> through the trouble once.

What am I missing here? (this typechecks with the above ‘foo’ type, but  
does not compile):

val x: foo = @{field = 1, field2 = “blah”, field3 = @[int]5}

This looks safe to me; field3 should be an integer array of length 5 with  
each entry initialized to 1?

> > > 1. If ‘foo2’ can be handled, why require a compiler argument?
> 
> To make sure that the user really knows what he is doing.

> > This seems to raise two questions:
> > 
> > 1. Why can’t ‘foo’ be handled?  
> > It seems to not be an issue of typechecking, as I can make an example  
> > using ‘foo’ that typechecks. But of course it errors on compilation.
> > 
> > 2. If ‘foo2’ can be handled, why require a compiler argument?
> > 
> > My guess for this one is that having arrays of arbitrary size can be  
> > unsafe (without using dependent types for array length), so the default is  
> > to disallow it. This seems especially dangerous for an unboxed record as it  
> > might create some issues on the stack?
> > 
> > Thanks,

> > > > > but could you post a short example about the use case for -  
> > > > > D\_ATS\_ARRAY\_FIELD?
> > > 
> > > Say you declare a type foo as follows:
> > > 
> > > typedef foo = @{  
> > > field= int  
> > > , field2= string  
> > > , field3= @[int][5] // this cannot be handled  
> > > }
> > > 
> > > ATS will not be able to handle it correctly. Such a type should be given  
> > > a name in C and then  
> > > this name can be used in ATS. However, the following type declaration  
> > > can be handled in ATS:
> > > 
> > > typedef foo2 = @{  
> > > field= int  
> > > , field2= string  
> > > , field3= @[int] // this can be handled correctly.
> > > 
> > > If you want foo2 to be handled, then you need to have -D\_ATS\_ARRAY\_FIELD  
> > > when compiling.

> > > > Is there any way to use $extmcall in C - perhaps if the object is a  
> > > > struct and one of its fields is a function pointer? Admittedly this is  
> > > > probably a rare situation, but am just curious.
> > > > 
> > > > Sorry for being possibly obtuse once again, but could you post a short  
> > > > example about the use case for -D\_ATS\_ARRAY\_FIELD?

> > > > > ---------- Forwarded message ----------  
> > > > > From: Hongwei Xi [hw...@bu.edu](mailto:hw...@bu.edu)  
> > > > > Date: Mon, Sep 29, 2014 at 1:37 PM  
> > > > > Subject: [ats-lang-users] ATS2-0.1.3 released  
> > > > > To: [ats-lan...@lists.sourceforge.net](mailto:ats-lan...@lists.sourceforge.net)
> > > > > 
> > > > > Hi,
> > > > > 
> > > > > I am glad to announce the release of ATS2-0.1.3.
> > > > > 
> > > > > The official website for ATS is: [http://www.ats-lang.org](http://www.ats-lang.org)
> > > > > 
> > > > > The following packages are included in this release:
> > > > > 
> > > > > ATS2-Postiats-0.1.3.tgz  
> > > > > ATS2-Postiats-include-0.1.3.tgz
> > > > > 
> > > > > After installing ATS-Postiats-include, one can compile  
> > > > > the C code generated from ATS source without installing  
> > > > > the ATS compiler. So a convenient way to distribute software  
> > > > > written in ATS is to simply release the C code generated  
> > > > > from the ATS source.
> > > > > 
> > > > > See below for some major additions and changes in ATS2-0.1.3.
> > > > > 
> > > > > Cheers!
> > > > > 
> > > > > –Hongwei
> > > > > 
> > > > > This is the 12th release of ATS2, the successor of the ATS  
> > > > > programming language. The compiler for ATS2 is given the name  
> > > > > ATS/Positats, ATS2/Postiats or simply Postiats.
> > > > > 
> > > > > The official website for ATS is:
> > > > > 
> > > > > [http://www.ats-lang.org](http://www.ats-lang.org)
> > > > > 
> > > > > ATS-Postiats is hosted at github:
> > > > > 
> > > > > [GitHub - githwxi/ATS-Postiats: ATS2: Unleashing the Potentials of Types and Templates](https://github.com/githwxi/ATS-Postiats)
> > > > > 
> > > > > Major releases of ATS2 are available at:
> > > > > 
> > > > > [ats2-lang download | SourceForge.net](https://sourceforge.net/projects/ats2-lang/)
> > > > > 
> > > > > Major releases of external packages for ATS2 are available at:
> > > > > 
> > > > > [ats2-lang-contrib download | SourceForge.net](https://sourceforge.net/projects/ats2-lang-contrib/)
> > > > > 
> > > > > Here is a list of major additions and changes since the last release:
> > > > > 
> > > > > 1. Adding support for dot-notation overloading in assignments.  
> > > > > This feature is mostly for interacting ATS with other languages.  
> > > > > See ATS2TUTORIAL/CHAP\_DOTOVERLD for a short article of explanation.
> > > > > 2. Adding support for functional style o dot-notation overloading.  
> > > > > This feature makes it very convenient for ATS to interact with OOP.
> > > > > 3. Generally improving level-2 jsonization (pats\_dynexp2\_jsonize)
> > > > > 4. Adding support for extvar decl. (which is different from $extval):  
> > > > > extvar “external\_name” = internal\_value
> > > > > 5. ATS\_DYNLOADFLAG is set to 1 by default only for DATS-files. So  
> > > > > dynloading SATS-files is no longer necessary (but it is still  
> > > > > harmless).
> > > > > 6. Adding support for $extmcall(ret\_type, obj, “method”, arglst),  
> > > > > which translates into the method invocation: obj.method(arglst)
> > > > > 7. Adding -D\_ATS\_ARRAY\_FIELD to safe-guard using array fields in  
> > > > > records.
> > > > > 
> > > > > * * *
> > > > > 
> > > > > Slashdot TV. Videos for Nerds. Stuff that Matters.
> > > > > 
> > > > > [http://pubads.g.doubleclick.net/gampad/clk?id=160591471&iu=/4140/ostg.clktrk](http://pubads.g.doubleclick.net/gampad/clk?id=160591471&iu=/4140/ostg.clktrk)
> > > > > 
> > > > > * * *
> > > > > 
> > > > > ats-lang-users mailing list  
> > > > > [ats-lan...@lists.sourceforge.net](mailto:ats-lan...@lists.sourceforge.net)  
> > > > > [ats-lang-users List Signup and Options](https://lists.sourceforge.net/lists/listinfo/ats-lang-users)
> > > > > 
> > > > > –  
> > > > > 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](mailto:ats-lang-user...@googlegroups.com).  
> > > > > To post to this group, send email to [ats-lan...@googlegroups.com](mailto:ats-lan...@googlegroups.com).  
> > > > > Visit this group at [http://groups.google.com/group/ats-lang-users](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/CAPPSPLrXVW-cXge0GccpOjFZf6p3CN5oLggbbaH2LxX-E916uQ%40mail.gmail.com](https://groups.google.com/d/msgid/ats-lang-users/CAPPSPLrXVW-cXge0GccpOjFZf6p3CN5oLggbbaH2LxX-E916uQ%40mail.gmail.com)  
> > > > > [https://groups.google.com/d/msgid/ats-lang-users/CAPPSPLrXVW-cXge0GccpOjFZf6p3CN5oLggbbaH2LxX-E916uQ%40mail.gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/ats-lang-users/CAPPSPLrXVW-cXge0GccpOjFZf6p3CN5oLggbbaH2LxX-E916uQ%40mail.gmail.com?utm_medium=email&utm_source=footer)  
> > > > > .
> > > > 
> > > > –  
> > > > Brandon Barker  
> > > > [brandon...@gmail.com](mailto:brandon...@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](mailto:ats-lang-user...@googlegroups.com).  
> > > > To post to this group, send email to [ats-lan...@googlegroups.com](mailto:ats-lan...@googlegroups.com).  
> > > > Visit this group at [http://groups.google.com/group/ats-lang-users](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/CAORbNRpHLbLh0OvpqsC\_hyvefX18UMmrtsP6bmcoFrNbGx%2BQjg%40mail.gmail.com](https://groups.google.com/d/msgid/ats-lang-users/CAORbNRpHLbLh0OvpqsC_hyvefX18UMmrtsP6bmcoFrNbGx%2BQjg%40mail.gmail.com)  
> > > > [https://groups.google.com/d/msgid/ats-lang-users/CAORbNRpHLbLh0OvpqsC\_hyvefX18UMmrtsP6bmcoFrNbGx%2BQjg%40mail.gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/ats-lang-users/CAORbNRpHLbLh0OvpqsC_hyvefX18UMmrtsP6bmcoFrNbGx%2BQjg%40mail.gmail.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-user...@googlegroups.com](mailto:ats-lang-user...@googlegroups.com).  
> > > To post to this group, send email to [ats-lan...@googlegroups.com](mailto:ats-lan...@googlegroups.com).  
> > > Visit this group at [http://groups.google.com/group/ats-lang-users](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/CAPPSPLqfVhhJ8qV5gHDGpnjPuiDu1GPQ2\_p-YbhVPqiFFPR1Lw%40mail.gmail.com](https://groups.google.com/d/msgid/ats-lang-users/CAPPSPLqfVhhJ8qV5gHDGpnjPuiDu1GPQ2_p-YbhVPqiFFPR1Lw%40mail.gmail.com)  
> > > [https://groups.google.com/d/msgid/ats-lang-users/CAPPSPLqfVhhJ8qV5gHDGpnjPuiDu1GPQ2\_p-YbhVPqiFFPR1Lw%40mail.gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/ats-lang-users/CAPPSPLqfVhhJ8qV5gHDGpnjPuiDu1GPQ2_p-YbhVPqiFFPR1Lw%40mail.gmail.com?utm_medium=email&utm_source=footer)  
> > > .
> > 
> > –  
> > Brandon Barker  
> > [brandon...@gmail.com](mailto:brandon...@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](mailto:ats-lang-user...@googlegroups.com).  
> > To post to this group, send email to [ats-lan...@googlegroups.com](mailto:ats-lan...@googlegroups.com).  
> > Visit this group at [http://groups.google.com/group/ats-lang-users](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/CAORbNRq-MEq2wZveSGohQyrGEOBL9fLAc3-kbmbZDR-xzOV7Vg%40mail.gmail.com](https://groups.google.com/d/msgid/ats-lang-users/CAORbNRq-MEq2wZveSGohQyrGEOBL9fLAc3-kbmbZDR-xzOV7Vg%40mail.gmail.com)  
> > [https://groups.google.com/d/msgid/ats-lang-users/CAORbNRq-MEq2wZveSGohQyrGEOBL9fLAc3-kbmbZDR-xzOV7Vg%40mail.gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/ats-lang-users/CAORbNRq-MEq2wZveSGohQyrGEOBL9fLAc3-kbmbZDR-xzOV7Vg%40mail.gmail.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-user...@googlegroups.com](mailto:ats-lang-user...@googlegroups.com).  
> To post to this group, send email to [ats-lan...@googlegroups.com](mailto:ats-lan...@googlegroups.com).  
> Visit this group at [http://groups.google.com/group/ats-lang-users](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/CAPPSPLrorB6aMys%3Dqv%3DbackaYe9SaKAZ6Y4gH9Jd2VfG7fT-Vw%40mail.gmail.com](https://groups.google.com/d/msgid/ats-lang-users/CAPPSPLrorB6aMys%3Dqv%3DbackaYe9SaKAZ6Y4gH9Jd2VfG7fT-Vw%40mail.gmail.com)  
> [https://groups.google.com/d/msgid/ats-lang-users/CAPPSPLrorB6aMys%3Dqv%3DbackaYe9SaKAZ6Y4gH9Jd2VfG7fT-Vw%40mail.gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/ats-lang-users/CAPPSPLrorB6aMys%3Dqv%3DbackaYe9SaKAZ6Y4gH9Jd2VfG7fT-Vw%40mail.gmail.com?utm_medium=email&utm_source=footer)  
> .

Brandon Barker  
[brandon...@gmail.com](mailto:brandon...@gmail.com)

---

<div class="post-metadata">

**Author:** ![gmhwxi](https://avatars.discourse-cdn.com/v4/letter/g/67e7ee/32.png) [@gmhwxi](https://discourse.ats-lang.org/u/gmhwxi)\
**Post date:** [October 3, 2014, 7:18pm UTC](https://discourse.ats-lang.org/t/ats2-0-1-3-released/600/18 "2014-10-03T19:18:09Z")

</div>

> > but could you post a short example about the use case for -  
> > D\_ATS\_ARRAY\_FIELD?

Say you declare a type foo as follows:

typedef foo = @{  
field= int  
, field2= string  
, field3= @[int][5] // this cannot be handled  
}

ATS will not be able to handle it correctly. Such a type should be given a  
name in C and then  
this name can be used in ATS. However, the following type declaration can  
be handled in ATS:

typedef foo2 = @{  
field= int  
, field2= string  
, field3= @[int] // this can be handled correctly.

If you want foo2 to be handled, then you need to have -D\_ATS\_ARRAY\_FIELD  
when compiling.On Fri, Oct 3, 2014 at 10:04 AM, Brandon Barker [brandon...@gmail.com](mailto:brandon...@gmail.com) wrote:

> Is there any way to use $extmcall in C - perhaps if the object is a struct  
> and one of its fields is a function pointer? Admittedly this is probably a  
> rare situation, but am just curious.
> 
> Sorry for being possibly obtuse once again, but could you post a short  
> example about the use case for -D\_ATS\_ARRAY\_FIELD?
> 
> On Mon, Sep 29, 2014 at 1:39 PM, Hongwei Xi [gmh...@gmail.com](mailto:gmh...@gmail.com) wrote:
> 
> > ---------- Forwarded message ----------  
> > From: Hongwei Xi [hw...@bu.edu](mailto:hw...@bu.edu)  
> > Date: Mon, Sep 29, 2014 at 1:37 PM  
> > Subject: [ats-lang-users] ATS2-0.1.3 released  
> > To: [ats-lan...@lists.sourceforge.net](mailto:ats-lan...@lists.sourceforge.net)
> > 
> > Hi,
> > 
> > I am glad to announce the release of ATS2-0.1.3.
> > 
> > The official website for ATS is: [http://www.ats-lang.org](http://www.ats-lang.org)
> > 
> > The following packages are included in this release:
> > 
> > ATS2-Postiats-0.1.3.tgz  
> > ATS2-Postiats-include-0.1.3.tgz
> > 
> > After installing ATS-Postiats-include, one can compile  
> > the C code generated from ATS source without installing  
> > the ATS compiler. So a convenient way to distribute software  
> > written in ATS is to simply release the C code generated  
> > from the ATS source.
> > 
> > See below for some major additions and changes in ATS2-0.1.3.
> > 
> > Cheers!
> > 
> > –Hongwei
> > 
> > This is the 12th release of ATS2, the successor of the ATS  
> > programming language. The compiler for ATS2 is given the name  
> > ATS/Positats, ATS2/Postiats or simply Postiats.
> > 
> > The official website for ATS is:
> > 
> > [http://www.ats-lang.org](http://www.ats-lang.org)
> > 
> > ATS-Postiats is hosted at github:
> > 
> > [GitHub - githwxi/ATS-Postiats: ATS2: Unleashing the Potentials of Types and Templates](https://github.com/githwxi/ATS-Postiats)
> > 
> > Major releases of ATS2 are available at:
> > 
> > [ats2-lang download | SourceForge.net](https://sourceforge.net/projects/ats2-lang/)
> > 
> > Major releases of external packages for ATS2 are available at:
> > 
> > [ats2-lang-contrib download | SourceForge.net](https://sourceforge.net/projects/ats2-lang-contrib/)
> > 
> > Here is a list of major additions and changes since the last release:
> > 
> > 1. Adding support for dot-notation overloading in assignments.  
> > This feature is mostly for interacting ATS with other languages.  
> > See ATS2TUTORIAL/CHAP\_DOTOVERLD for a short article of explanation.
> > 2. Adding support for functional style o dot-notation overloading.  
> > This feature makes it very convenient for ATS to interact with OOP.
> > 3. Generally improving level-2 jsonization (pats\_dynexp2\_jsonize)
> > 4. Adding support for extvar decl. (which is different from $extval):  
> > extvar “external\_name” = internal\_value
> > 5. ATS\_DYNLOADFLAG is set to 1 by default only for DATS-files. So  
> > dynloading SATS-files is no longer necessary (but it is still  
> > harmless).
> > 6. Adding support for $extmcall(ret\_type, obj, “method”, arglst),  
> > which translates into the method invocation: obj.method(arglst)
> > 7. Adding -D\_ATS\_ARRAY\_FIELD to safe-guard using array fields in records.
> > 
> > * * *
> > 
> > Slashdot TV. Videos for Nerds. Stuff that Matters.
> > 
> > [http://pubads.g.doubleclick.net/gampad/clk?id=160591471&iu=/4140/ostg.clktrk](http://pubads.g.doubleclick.net/gampad/clk?id=160591471&iu=/4140/ostg.clktrk)
> > 
> > * * *
> > 
> > ats-lang-users mailing list  
> > [ats-lan...@lists.sourceforge.net](mailto:ats-lan...@lists.sourceforge.net)  
> > [ats-lang-users List Signup and Options](https://lists.sourceforge.net/lists/listinfo/ats-lang-users)
> > 
> > –  
> > 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](mailto:ats-lang-user...@googlegroups.com).  
> > To post to this group, send email to [ats-lan...@googlegroups.com](mailto:ats-lan...@googlegroups.com).  
> > Visit this group at [http://groups.google.com/group/ats-lang-users](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/CAPPSPLrXVW-cXge0GccpOjFZf6p3CN5oLggbbaH2LxX-E916uQ%40mail.gmail.com](https://groups.google.com/d/msgid/ats-lang-users/CAPPSPLrXVW-cXge0GccpOjFZf6p3CN5oLggbbaH2LxX-E916uQ%40mail.gmail.com)  
> > [https://groups.google.com/d/msgid/ats-lang-users/CAPPSPLrXVW-cXge0GccpOjFZf6p3CN5oLggbbaH2LxX-E916uQ%40mail.gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/ats-lang-users/CAPPSPLrXVW-cXge0GccpOjFZf6p3CN5oLggbbaH2LxX-E916uQ%40mail.gmail.com?utm_medium=email&utm_source=footer)  
> > .
> 
> –  
> Brandon Barker  
> [brandon...@gmail.com](mailto:brandon...@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](mailto:ats-lang-user...@googlegroups.com).  
> To post to this group, send email to [ats-lan...@googlegroups.com](mailto:ats-lan...@googlegroups.com).  
> Visit this group at [http://groups.google.com/group/ats-lang-users](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/CAORbNRpHLbLh0OvpqsC\_hyvefX18UMmrtsP6bmcoFrNbGx%2BQjg%40mail.gmail.com](https://groups.google.com/d/msgid/ats-lang-users/CAORbNRpHLbLh0OvpqsC_hyvefX18UMmrtsP6bmcoFrNbGx%2BQjg%40mail.gmail.com)  
> [https://groups.google.com/d/msgid/ats-lang-users/CAORbNRpHLbLh0OvpqsC\_hyvefX18UMmrtsP6bmcoFrNbGx%2BQjg%40mail.gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/ats-lang-users/CAORbNRpHLbLh0OvpqsC_hyvefX18UMmrtsP6bmcoFrNbGx%2BQjg%40mail.gmail.com?utm_medium=email&utm_source=footer)  
> .

---

<div class="post-metadata">

**Author:** ![Brandon\_Barker](https://sea1.discourse-cdn.com/flex019/user_avatar/discourse.ats-lang.org/brandon_barker/32/61_2.png) [@Brandon\_Barker](https://discourse.ats-lang.org/u/Brandon_Barker)\
**Post date:** [October 2, 2014, 11:49pm UTC](https://discourse.ats-lang.org/t/ats2-0-1-3-released/600/19 "2014-10-02T23:49:37Z")

</div>

> gmhwxi [gmh...@gmail.com](mailto:gmh...@gmail.com) skribis:
> 
> > > > In a function call, you have a function and some arguments; c0.get should  
> > > > be the  
> > > > function part inside a function call.
> > 
> > In programming languages, the right terminology for this is to say that  
> > c0.get must be  
> > in an _applied_ position.
> 
> IMO this OOPish notation is confusing, but that’s not your fault. 🙂  
> The problem (obvious after some use of Python) is that the thing to  
> the left of the period is an argument, and so has to be thought of as  
> if it were the first thing after the ‘(’.
> 
> Still, it might prove useful even for OOP-skeptical me, one day.
> 
> (20 years ago I was OOP-boosting, but now I am OOP-skeptical. 😃 )

Sort of similar for me, though less expert and a more condense timeline 🙂

> –  
> 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](mailto:ats-lang-user...@googlegroups.com).  
> To post to this group, send email to [ats-lan...@googlegroups.com](mailto:ats-lan...@googlegroups.com).  
> Visit this group at [http://groups.google.com/group/ats-lang-users](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/20141002234730.GA9770%40crud](https://groups.google.com/d/msgid/ats-lang-users/20141002234730.GA9770%40crud).

Brandon Barker  
[brandon...@gmail.com](mailto:brandon...@gmail.com)
