【发布时间】:2014-10-02 09:33:45
【问题描述】:
http://radar.oreilly.com/2013/05/dart-is-not-the-language-you-think-it-is.html
冒着提出愚蠢问题的风险:
我以前从未见过这种语法:
// Dart
class Point {
num x, y;
Point(this.x, this.y);
String toString() => 'X: $x, Y: $y';
}
> 是否表示引用?
import 'dart:mirrors';
class LoggingProxy {
InstanceMirror mirror;
LoggingProxy(delegate)
: mirror = reflect(delegate);
noSuchMethod(Invocation invocation) {
var name = invocation.memberName;
print('${name} was called');
return mirror.delegate(invocation);
}
}
什么是冒号:
LoggingProxy(delegate)
: mirror = reflect(delegate);
在做什么?
【问题讨论】:
标签: dart