Skip to content

RFC: Variadic Generics #362

Open
Open
@barcharcraz

Description

@barcharcraz

As far as I can tell Nimrod does not support any kind of variadic generic. That is a generic procedure that can take 0 or more type arguments.

The motivation for this is for functions like printf where you would like to have a variadic function where each one of the variadic parameters has a different type. The varargs feature does not do this.

Both c++ and D implement variadic generics in such a way where a parameter of type T... can be zero or more types and it can be decomposed into T1, Rest... in a parameter list.

For reference both c++ and D support this feature
http://dlang.org/variadic-function-templates.html
Variadic Templates, section 14.5.3 of the latest c++ draft standard (n3242)
Rust has a ticket open for this at: rust-lang/rust#10124

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions