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
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
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
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
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
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ats-lang-users
FYI.
I have just added some support for using variadic functions in ATS. Here is a running example: