Thread overview
strict varargs
Feb 04, 2002
Pavel Minayev
Feb 04, 2002
Russ Lewis
Feb 04, 2002
Pavel Minayev
February 04, 2002
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




February 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))) ]


February 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.
That
> can already be done; question is, it it worth having the compiler do it
for 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.