[Grace-core] Dart constructors

James Noble kjx at ecs.vuw.ac.nz
Wed Apr 24 23:28:21 PDT 2013


still thinking about inheritance & constructors,
for those who haven't see it, here's the latest from Dart:

https://www.dartlang.org/dart-tips/dart-tips-ep-11.html

http://www.dartlang.org/docs/spec/latest/dart-language-specification.html#h.500yt9xvog42

in particular - there are initialiser lists that set final fields;
these initialisers don't permit the use of "this".
I guess that forbids Dart's lambdas (2 different syntaxes) from appearing their either

J

> 
> After all the initializers have completed, the body of k is executed in a scope where this is bound to i. Execution of the body begins with execution of the body of the superconstructor with this bound to i, the type parameters of the immediately enclosing class bound to a set of actual type arguments V1, ... , Vm  and the formal parameter bindings determined by the argument list of the superinitializer of k.
> This process ensures that no uninitialized final field is ever seen by code. Note that this  is not in scope on the right hand side of an initializer so no instance method can execute during initialization: an instance method cannot be directly invoked, nor can this be passed into any other code being invoked in the initializer.


More information about the Grace-core mailing list