C# style params or python style *args in functions? (Did I miss this?)

201 views
Skip to first unread message

Kevin Moore

unread,
Jun 13, 2012, 4:38:35 PM6/13/12
to General Dart Discussion
Is there a model in Dart for saying "0 or more of this thing" in a
function def? Similar to "params T[] args" in C# or "*args" in python?

Did I miss it? Planned? Open issue?

Seth Ladd

unread,
Jun 13, 2012, 5:04:27 PM6/13/12
to Kevin Moore, General Dart Discussion
Hi Kevin,


I didn't find an open language feature for varargs or rest params, so it's probably one of those "later" issues. Of course, if you have some compelling use cases, please do file a new feature request at dartbug.com for review in the future.

Thanks,
Seth

Ladislav Thon

unread,
Jun 14, 2012, 4:07:47 AM6/14/12
to Kevin Moore, General Dart Discussion
Is there a model in Dart for saying "0 or more of this thing" in a
function def? Similar to "params T[] args" in C# or "*args" in python?

Did I miss it? Planned? Open issue?

IIRC, Dart used to have those, but they were removed because they didn't play nicely with optional/named arguments. I hope they are coming back, sooner or later.

LT
Reply all
Reply to author
Forward
0 new messages