Skip to content

Instantly share code, notes, and snippets.

@zidenis
Last active May 9, 2017 22:43
Show Gist options
  • Save zidenis/337e22e8f32079463f6569b33da3d7a1 to your computer and use it in GitHub Desktop.
Save zidenis/337e22e8f32079463f6569b33da3d7a1 to your computer and use it in GitHub Desktop.
void main() {
var prettyFunc = new PrettyPrint();
print(prettyFunc is Function); // true
prettyFunc.call("A", "Dart is cool", "B"); // A Dart is cool B
prettyFunc("C", "Dart is cool", "D"); // C Dart is cool D
var args = ["E", "Dart is cool", "F"]; // E Dart is cool F
Function.apply(prettyFunc, args);
}
class PrettyPrint {
call(prefix, msg, sufix) =>
print("$prefix $msg $sufix");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment