rubydartinstance-variablesdart-mirrors

Is there an equivalent in Dart of the instance_variable_set method in Ruby?


If not, is there anything like this on the horizon?

This is the one feature of JavaScript, Ruby, and Perl that I can't live without. I know you can fake it with a hash member, but I want to be able to create (arbitrary) "first class" members from a parser.


Solution

  • Currently there's nothing that can set a field that doesn't yet exist. The mirror API can be used to set fields that already exist, and may eventually be extended to support defining new fields dynamically.