Skip to content

Instantly share code, notes, and snippets.

@vsavkin
Created May 2, 2014 21:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vsavkin/3f44ec77faf14a75fa0d to your computer and use it in GitHub Desktop.
Save vsavkin/3f44ec77faf14a75fa0d to your computer and use it in GitHub Desktop.
import 'dart:mirrors';
class Person {
hello() => "hello";
}
// you can define the send function as follow:
send(obj, message, [args = const []]) =>
reflect(obj).invoke(message, args).reflectee;
main (){
var p = new Person();
print(send(p, #hello));
}
// you can read about mirrors here: https://www.dartlang.org/articles/reflection-with-mirrors/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment