Created
May 2, 2014 21:17
-
-
Save vsavkin/3f44ec77faf14a75fa0d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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