CodePudding user response:
Find a way to copy write:
Typedef dynamic OnCall (List);
The class VarargsFunction extends the Function {
OnCall _onCall;
VarargsFunction (enclosing _onCall);
Call ()=& gt; _onCall ([]);
NoSuchMethod (Invocation Invocation) {
Final arguments=invocation. PositionalArguments;
Return _onCall (the arguments);
}
}
The main () {
Final superHeroes=new VarargsFunction ((the arguments) {
For (final superHero in the arguments) {
Print (" There 's no stopping ${superHero} ");
}
});
SuperHeroes (' UberMan ', 'Exceptional' Woman ', 'The Hunk');
}
You have a better way? Talk about bai