D - strict varargs
- Pavel Minayev (4/4) Feb 04 2002 How about a syntax to define a function that takes an unlimited number
- Russ Lewis (8/12) Feb 04 2002 That would not be far from simply taking a dynamic array of those types....
- Pavel Minayev (7/9) Feb 04 2002 That
How about a syntax to define a function that takes an unlimited number of arguments of _one_, strictly defined type? Something like this: void printfi(int count, int...); // takes unlimited number of ints void printfs(int count, char[]...); // takes unlimited number of strings
Feb 04 2002
That would not be far from simply taking a dynamic array of those types. That can already be done; question is, it it worth having the compiler do it for you? Pavel Minayev wrote:How about a syntax to define a function that takes an unlimited number of arguments of _one_, strictly defined type? Something like this: void printfi(int count, int...); // takes unlimited number of ints void printfs(int count, char[]...); // takes unlimited number of strings-- The Villagers are Online! villagersonline.com .[ (the fox.(quick,brown)) jumped.over(the dog.lazy) ] .[ (a version.of(English).(precise.more)) is(possible) ] ?[ you want.to(help(develop(it))) ]
Feb 04 2002
"Russ Lewis" <spamhole-2001-07-16 deming-os.org> wrote in message news:3C5EFE95.E9A3B0DB deming-os.org...That would not be far from simply taking a dynamic array of those types.Thatcan already be done; question is, it it worth having the compiler do itfor you? If we have array literals, no. It'd look like this, then: printfi([1, 2, 3]); But we don't have them and we don't know if they'll be there or not.
Feb 04 2002