how does $list(...) work ? Can I make my own vararg function ?

75 views
Skip to first unread message

Russoul

unread,
Nov 5, 2017, 7:51:26 AM11/5/17
to ats-lang-users
As I understand  varargs are not supported in ATS2 ? But $list and similar functions somehow use this feature. How does it work ?

gmhwxi

unread,
Nov 7, 2017, 5:15:35 PM11/7/17
to ats-lang-users

$list is handled specially. Another one is $arraypsz
(for creating linear arrays).

I read various messages posted in this group and realized that
variadic functions are not yet supported. I will now try to add some
support for variadic functions so that it can go into the next release.

In ATS1, one can implement variadic functions in a type-safe manner.
I do not plan to support this yet in ATS2. What I plan to do is to support
calling (not implementing) variadic functions in ATS2 in a type-safe manner.

Cheers!

gmhwxi

unread,
Nov 10, 2017, 12:57:34 PM11/10/17
to ats-lang-users

FYI.

I have just added some support for using variadic functions in ATS.
Here is a running example:

https://github.com/githwxi/ATS-Postiats/blob/master/doc/EXAMPLE/TESTATS/variadic.dats

The changes to ATS/Postiats are planned to to into the next release of ATS (ATS2-0.3.8).

Cheers!

Russoul

unread,
Nov 10, 2017, 1:37:37 PM11/10/17
to ats-lang-users
Nice !


пятница, 10 ноября 2017 г., 20:57:34 UTC+3 пользователь gmhwxi написал:
Reply all
Reply to author
Forward
0 new messages