Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass Vararg #191

Open
steinwaywhw opened this issue May 1, 2018 · 1 comment
Open

Pass Vararg #191

steinwaywhw opened this issue May 1, 2018 · 1 comment

Comments

@steinwaywhw
Copy link
Contributor

It seems that we can't pass varargs.

extern fun printf1 {ts:types} (fmt: string, args: ts): void = "mac#printf"

extern fun printf2 {ts:types} (fmt: string, args: ts): void
implement  printf2 {ts} (fmt, args) = printf1 {ts} (fmt, args)

implement main0 () = let
   val _ = printf1 ("%s\n", $vararg("helloworld"))
   val _ = printf2 ("%s\n", $vararg("helloworld")) // can't do this, causing C syntax errors. 
in 
end
@Hibou57
Copy link
Contributor

Hibou57 commented Jul 10, 2018

Hi,

I have not tried your sample, but there is an example use case of variadic arguments, here: https://github.com/githwxi/ATS-Postiats/blob/master/doc/EXAMPLE/TESTATS/variadic.dats

If it does not help, I may try to look further (just can’t promise).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants