Higher-order function: Difference between revisions

Content deleted Content added
DarthKitty (talk | contribs)
Mikeh88 (talk | contribs)
Added an example for Dart
Line 206:
writeln(g(7)); // 13
}
</syntaxhighlight>'''Dart'''
{{further information|Elixir (programming language)}}<syntaxhighlight lang="dart" line="1">
int Function(int) twice(int Function(int) f) {
return (x) {
return f(f(x));
};
}
 
int plusThree(int i) {
return i + 3;
}
 
void main() {
final g = twice(plusThree);
print(g(7)); // 13
}
 
</syntaxhighlight>