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

discussion: Convert array to varargs. #2956

Closed
rbscott opened this issue Jul 27, 2019 · 2 comments
Closed

discussion: Convert array to varargs. #2956

rbscott opened this issue Jul 27, 2019 · 2 comments
Labels
question No questions on the issue tracker, please.
Milestone

Comments

@rbscott
Copy link
Contributor

rbscott commented Jul 27, 2019

Looking through the source code, I found examples like this where variable args are passed in as variable args.

    pub fn fmt(self: *Builder, comptime format: []const u8, args: ...) []u8 {
        return fmt_lib.allocPrint(self.allocator, format, args) catch unreachable;
    }

Is there is a way to convert an array into variable args? I think the size would have to be known at compile time, but an array could work in this case.

@emekoi
Copy link
Contributor

emekoi commented Jul 27, 2019

see #208.

@andrewrk andrewrk added this to the 0.6.0 milestone Jul 29, 2019
@andrewrk andrewrk added the question No questions on the issue tracker, please. label Feb 10, 2020
@andrewrk
Copy link
Member

andrewrk commented Feb 10, 2020

Solved by #208, @call, and tuple concatenation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question No questions on the issue tracker, please.
Projects
None yet
Development

No branches or pull requests

3 participants