Davy Mitchell
2015-10-23 15:29:11 UTC
Hi All,
I was writing some setters for a class and wondered if the constructor
shortcut syntax would make sense.
For example:
set x(this._x) {
updatePos();
}
Instead of:
set x(int newX) {
_x = newX;
updatePos();
}
I like it but it is sugary :-) Does save a line when you have a number of
setters.
Thanks,
Davy
--
Diving Into Dart - http://divingintodart.blogspot.co.uk/
I was writing some setters for a class and wondered if the constructor
shortcut syntax would make sense.
For example:
set x(this._x) {
updatePos();
}
Instead of:
set x(int newX) {
_x = newX;
updatePos();
}
I like it but it is sugary :-) Does save a line when you have a number of
setters.
Thanks,
Davy
--
Diving Into Dart - http://divingintodart.blogspot.co.uk/
--
For other discussions, see https://groups.google.com/a/dartlang.org/
For HOWTO questions, visit http://stackoverflow.com/tags/dart
To file a bug report or feature request, go to http://www.dartbug.com/new
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
For other discussions, see https://groups.google.com/a/dartlang.org/
For HOWTO questions, visit http://stackoverflow.com/tags/dart
To file a bug report or feature request, go to http://www.dartbug.com/new
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.