# Varargs functions?

**URL:** <https://discourse.ats-lang.org/t/varargs-functions/502>\
**Category:** Google Group\
**Created:** [September 13, 2014, 3:47pm UTC](https://discourse.ats-lang.org/t/varargs-functions/502 "2014-09-13T15:47:41Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shea\_Levy](https://avatars.discourse-cdn.com/v4/letter/s/b38774/32.png) [@Shea\_Levy](https://discourse.ats-lang.org/u/Shea_Levy)\
**Post date:** [September 13, 2014, 3:47pm UTC](https://discourse.ats-lang.org/t/varargs-functions/502/1 "2014-09-13T15:47:41Z")

</div>

Hi all,

Does ATS support varargs functions? What about macros or templates with  
variable template arguments?

~Shea

---

<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 13, 2014, 7:15pm UTC](https://discourse.ats-lang.org/t/varargs-functions/502/2 "2014-09-13T19:15:23Z")

</div>

I had to read the source code for ATS1 and ATS2.

Support for varargs in ATS2 is not finished yet. I may just support  
typechecking  
variadic functions in ATS2 but implementing such functions needs to be done  
elsewhere.  
In ATS1, you can implement variadic functions, but the mechanism is very  
complex  
and thus of little value.On Saturday, September 13, 2014 2:33:47 PM UTC-4, Shea Levy wrote:

> I see, thanks. Where in the code should I look to find these kinds of  
> things?
> 
> ~Shea
> 
> -------- Original message --------  
> From: Hongwei Xi  
> Date:09/13/2014 1:09 PM (GMT-05:00)  
> To: [ats-l...@googlegroups.com](mailto:ats-l...@googlegroups.com) \<javascript:\>  
> Subject: Re: Varargs functions?
> 
> Actually, I am not sure whether ATS2 supports varargs. ATS1 does support.  
> I need to read the code.
> 
> Macros with varargs: Yes, I think it is implemented. I need to read the  
> code  
> to see how the feature can be used.
> 
> Templates with variable template arguments: No, it is not supported
> 
> On Sat, Sep 13, 2014 at 11:47 AM, Shea Levy \<[sh...@shealevy.com](mailto:sh...@shealevy.com) \<javascript:\>\> wrote:
> 
> > Hi all,
> > 
> > Does ATS support varargs functions? What about macros or templates with  
> > variable template arguments?
> > 
> > ~Shea
> > 
> > –  
> > You received this message because you are subscribed to the Google Groups  
> > “ats-lang-users” group.  
> > To unsubscribe from this group and stop receiving emails from it, send an  
> > email to [ats-lang...@googlegroups.com](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/20140913154741.GE2275%40nixos.hsd1.nh.comcast.net](https://groups.google.com/d/msgid/ats-lang-users/20140913154741.GE2275%40nixos.hsd1.nh.comcast.net)  
> > .
> 
> –  
> You received this message because you are subscribed to the Google Groups  
> “ats-lang-users” group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [ats-lang...@googlegroups.com](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/CAPPSPLrmFNwvVOtCfvc0%2BytH7LoQHVCtp%3DKUTS72oFtxFjVpsg%40mail.gmail.com](https://groups.google.com/d/msgid/ats-lang-users/CAPPSPLrmFNwvVOtCfvc0%2BytH7LoQHVCtp%3DKUTS72oFtxFjVpsg%40mail.gmail.com)  
> [https://groups.google.com/d/msgid/ats-lang-users/CAPPSPLrmFNwvVOtCfvc0%2BytH7LoQHVCtp%3DKUTS72oFtxFjVpsg%40mail.gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/ats-lang-users/CAPPSPLrmFNwvVOtCfvc0%2BytH7LoQHVCtp%3DKUTS72oFtxFjVpsg%40mail.gmail.com?utm_medium=email&utm_source=footer)  
> .

---

<div class="post-metadata">

**Author:** ![Shea\_Levy](https://avatars.discourse-cdn.com/v4/letter/s/b38774/32.png) [@Shea\_Levy](https://discourse.ats-lang.org/u/Shea_Levy)\
**Post date:** [September 20, 2014, 6:43pm UTC](https://discourse.ats-lang.org/t/varargs-functions/502/3 "2014-09-20T18:43:04Z")

</div>

Is something like C’s stdarg.h not applicable?

~SheaOn Sat, Sep 13, 2014 at 12:15:23PM -0700, gmhwxi wrote:

> I had to read the source code for ATS1 and ATS2.
> 
> Support for varargs in ATS2 is not finished yet. I may just support  
> typechecking  
> variadic functions in ATS2 but implementing such functions needs to be done  
> elsewhere.  
> In ATS1, you can implement variadic functions, but the mechanism is very  
> complex  
> and thus of little value.
> 
> On Saturday, September 13, 2014 2:33:47 PM UTC-4, Shea Levy wrote:
> 
> > I see, thanks. Where in the code should I look to find these kinds of  
> > things?
> > 
> > ~Shea
> > 
> > -------- Original message --------  
> > From: Hongwei Xi  
> > Date:09/13/2014 1:09 PM (GMT-05:00)  
> > To: [ats-l...@googlegroups.com](mailto:ats-l...@googlegroups.com) \<javascript:\>  
> > Subject: Re: Varargs functions?
> > 
> > Actually, I am not sure whether ATS2 supports varargs. ATS1 does support.  
> > I need to read the code.
> > 
> > Macros with varargs: Yes, I think it is implemented. I need to read the  
> > code  
> > to see how the feature can be used.
> > 
> > Templates with variable template arguments: No, it is not supported
> > 
> > On Sat, Sep 13, 2014 at 11:47 AM, Shea Levy \<[sh...@shealevy.com](mailto:sh...@shealevy.com) \<javascript:\>\> wrote:
> > 
> > > Hi all,
> > > 
> > > Does ATS support varargs functions? What about macros or templates with  
> > > variable template arguments?
> > > 
> > > ~Shea
> > > 
> > > –  
> > > You received this message because you are subscribed to the Google Groups  
> > > “ats-lang-users” group.  
> > > To unsubscribe from this group and stop receiving emails from it, send an  
> > > email to [ats-lang...@googlegroups.com](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/20140913154741.GE2275%40nixos.hsd1.nh.comcast.net](https://groups.google.com/d/msgid/ats-lang-users/20140913154741.GE2275%40nixos.hsd1.nh.comcast.net)  
> > > .
> > 
> > –  
> > You received this message because you are subscribed to the Google Groups  
> > “ats-lang-users” group.  
> > To unsubscribe from this group and stop receiving emails from it, send an  
> > email to [ats-lang...@googlegroups.com](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/CAPPSPLrmFNwvVOtCfvc0%2BytH7LoQHVCtp%3DKUTS72oFtxFjVpsg%40mail.gmail.com](https://groups.google.com/d/msgid/ats-lang-users/CAPPSPLrmFNwvVOtCfvc0%2BytH7LoQHVCtp%3DKUTS72oFtxFjVpsg%40mail.gmail.com)  
> > [https://groups.google.com/d/msgid/ats-lang-users/CAPPSPLrmFNwvVOtCfvc0%2BytH7LoQHVCtp%3DKUTS72oFtxFjVpsg%40mail.gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/ats-lang-users/CAPPSPLrmFNwvVOtCfvc0%2BytH7LoQHVCtp%3DKUTS72oFtxFjVpsg%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/84630ec2-0de0-4d68-b9d9-32445fcd36c6%40googlegroups.com](https://groups.google.com/d/msgid/ats-lang-users/84630ec2-0de0-4d68-b9d9-32445fcd36c6%40googlegroups.com).

---

<div class="post-metadata">

**Author:** ![Shea\_Levy](https://avatars.discourse-cdn.com/v4/letter/s/b38774/32.png) [@Shea\_Levy](https://discourse.ats-lang.org/u/Shea_Levy)\
**Post date:** [September 13, 2014, 6:33pm UTC](https://discourse.ats-lang.org/t/varargs-functions/502/4 "2014-09-13T18:33:42Z")

</div>

I see, thanks. Where in the code should I look to find these kinds of things?

~Shea

-------- Original message --------

From: Hongwei Xi 

Date:09/13/2014 1:09 PM (GMT-05:00) 

To: ats-lan...@googlegroups.com 

Subject: Re: Varargs functions? 

Actually, I am not sure whether ATS2 supports varargs. ATS1 does support. I need to read the code.

Macros with varargs: Yes, I think it is implemented. I need to read the code  
to see how the feature can be used.

Templates with variable template arguments: No, it is not supportedOn Sat, Sep 13, 2014 at 11:47 AM, Shea Levy [sh...@shealevy.com](mailto:sh...@shealevy.com) wrote:  
Hi all,

Does ATS support varargs functions? What about macros or templates with  
variable template arguments?

~Shea

You received this message because you are subscribed to the Google Groups “ats-lang-users” group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [ats-lang-user...@googlegroups.com](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/20140913154741.GE2275%40nixos.hsd1.nh.comcast.net](https://groups.google.com/d/msgid/ats-lang-users/20140913154741.GE2275%40nixos.hsd1.nh.comcast.net).

You received this message because you are subscribed to the Google Groups “ats-lang-users” group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [ats-lang-user...@googlegroups.com](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/CAPPSPLrmFNwvVOtCfvc0%2BytH7LoQHVCtp%3DKUTS72oFtxFjVpsg%40mail.gmail.com](https://groups.google.com/d/msgid/ats-lang-users/CAPPSPLrmFNwvVOtCfvc0%2BytH7LoQHVCtp%3DKUTS72oFtxFjVpsg%40mail.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:** [September 13, 2014, 5:09pm UTC](https://discourse.ats-lang.org/t/varargs-functions/502/5 "2014-09-13T17:09:17Z")

</div>

Actually, I am not sure whether ATS2 supports varargs. ATS1 does support.  
I need to read the code.

Macros with varargs: Yes, I think it is implemented. I need to read the code  
to see how the feature can be used.

Templates with variable template arguments: No, it is not supportedOn Sat, Sep 13, 2014 at 11:47 AM, Shea Levy [sh...@shealevy.com](mailto:sh...@shealevy.com) wrote:

> Hi all,
> 
> Does ATS support varargs functions? What about macros or templates with  
> variable template arguments?
> 
> ~Shea
> 
> –  
> You received this message because you are subscribed to the Google Groups  
> “ats-lang-users” group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [ats-lang-user...@googlegroups.com](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/20140913154741.GE2275%40nixos.hsd1.nh.comcast.net](https://groups.google.com/d/msgid/ats-lang-users/20140913154741.GE2275%40nixos.hsd1.nh.comcast.net)  
> .

---

<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 20, 2014, 9:04pm UTC](https://discourse.ats-lang.org/t/varargs-functions/502/6 "2014-09-20T21:04:20Z")

</div>

I will add stdarg.sats into ${PATSHOME}/libc/. at some point.  
Given my past experience, I would say that it can be quite complicated to  
use functions in stdarg.sats. One may just want to use stdarg.h directly  
instead.On Saturday, September 20, 2014 2:43:11 PM UTC-4, Shea Levy wrote:

> Is something like C’s stdarg.h not applicable?
> 
> ~Shea
> 
> On Sat, Sep 13, 2014 at 12:15:23PM -0700, gmhwxi wrote:
> 
> > I had to read the source code for ATS1 and ATS2.
> > 
> > Support for varargs in ATS2 is not finished yet. I may just support  
> > typechecking  
> > variadic functions in ATS2 but implementing such functions needs to be  
> > done  
> > elsewhere.  
> > In ATS1, you can implement variadic functions, but the mechanism is very  
> > complex  
> > and thus of little value.
> > 
> > On Saturday, September 13, 2014 2:33:47 PM UTC-4, Shea Levy wrote:
> > 
> > > I see, thanks. Where in the code should I look to find these kinds of  
> > > things?
> > > 
> > > ~Shea
> > > 
> > > -------- Original message --------  
> > > From: Hongwei Xi  
> > > Date:09/13/2014 1:09 PM (GMT-05:00)  
> > > To: [ats-l...@googlegroups.com](mailto:ats-l...@googlegroups.com) \<javascript:\>  
> > > Subject: Re: Varargs functions?
> > > 
> > > Actually, I am not sure whether ATS2 supports varargs. ATS1 does  
> > > support.  
> > > I need to read the code.
> > > 
> > > Macros with varargs: Yes, I think it is implemented. I need to read  
> > > the  
> > > code  
> > > to see how the feature can be used.
> > > 
> > > Templates with variable template arguments: No, it is not supported
> > > 
> > > On Sat, Sep 13, 2014 at 11:47 AM, Shea Levy \<[sh...@shealevy.com](mailto:sh...@shealevy.com) \<javascript:\>\> wrote:
> > > 
> > > > Hi all,
> > > > 
> > > > Does ATS support varargs functions? What about macros or templates  
> > > > with  
> > > > variable template arguments?
> > > > 
> > > > ~Shea
> > > > 
> > > > –  
> > > > You received this message because you are subscribed to the Google  
> > > > Groups  
> > > > “ats-lang-users” group.  
> > > > To unsubscribe from this group and stop receiving emails from it,  
> > > > send an  
> > > > email to [ats-lang...@googlegroups.com](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/20140913154741.GE2275%40nixos.hsd1.nh.comcast.net](https://groups.google.com/d/msgid/ats-lang-users/20140913154741.GE2275%40nixos.hsd1.nh.comcast.net)
> 
> > > > .
> > > 
> > > –  
> > > You received this message because you are subscribed to the Google  
> > > Groups  
> > > “ats-lang-users” group.  
> > > To unsubscribe from this group and stop receiving emails from it, send  
> > > an  
> > > email to [ats-lang...@googlegroups.com](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/CAPPSPLrmFNwvVOtCfvc0%2BytH7LoQHVCtp%3DKUTS72oFtxFjVpsg%40mail.gmail.com](https://groups.google.com/d/msgid/ats-lang-users/CAPPSPLrmFNwvVOtCfvc0%2BytH7LoQHVCtp%3DKUTS72oFtxFjVpsg%40mail.gmail.com)
> 
> > > \<  
> > > [https://groups.google.com/d/msgid/ats-lang-users/CAPPSPLrmFNwvVOtCfvc0%2BytH7LoQHVCtp%3DKUTS72oFtxFjVpsg%40mail.gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/ats-lang-users/CAPPSPLrmFNwvVOtCfvc0%2BytH7LoQHVCtp%3DKUTS72oFtxFjVpsg%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/84630ec2-0de0-4d68-b9d9-32445fcd36c6%40googlegroups.com](https://groups.google.com/d/msgid/ats-lang-users/84630ec2-0de0-4d68-b9d9-32445fcd36c6%40googlegroups.com).
