Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(488)

Unified Diff: corelib/src/num.dart

Issue 10832401: Gentle start with removing explicit interfaces (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: corelib/src/num.dart
===================================================================
--- corelib/src/num.dart (revision 11192)
+++ corelib/src/num.dart (working copy)
@@ -4,41 +4,43 @@
// Dart core library.
-interface num extends Comparable, Hashable {
+abstract class num implements Comparable, Hashable {
Ivan Posva 2012/08/23 06:13:44 This should be extends as far as I am concerned.
sra1 2012/08/23 18:18:19 You can only extend one class, but you can impleme
hausner 2012/08/23 18:34:10 It cannot be extends, because we can't extend more
+ factory num._uninstantiable() => null;
+
// Arithmetic operations.
- num operator +(num other);
- num operator -(num other);
- num operator *(num other);
- num operator %(num other);
- double operator /(num other);
+ abstract num operator +(num other);
+ abstract num operator -(num other);
+ abstract num operator *(num other);
+ abstract num operator %(num other);
+ abstract double operator /(num other);
// Truncating division.
- num operator ~/(num other);
+ abstract num operator ~/(num other);
// The unary '-' operator.
- num operator negate();
- num remainder(num other);
+ abstract num operator negate();
+ abstract num remainder(num other);
// Relational operations.
- bool operator <(num other);
- bool operator <=(num other);
- bool operator >(num other);
- bool operator >=(num other);
+ abstract bool operator <(num other);
+ abstract bool operator <=(num other);
+ abstract bool operator >(num other);
+ abstract bool operator >=(num other);
// Predicates.
- bool isNaN();
- bool isNegative();
- bool isInfinite();
+ abstract bool isNaN();
+ abstract bool isNegative();
+ abstract bool isInfinite();
- num abs();
- num round();
- num floor();
- num ceil();
- num truncate();
+ abstract num abs();
+ abstract num round();
+ abstract num floor();
+ abstract num ceil();
+ abstract num truncate();
- int toInt();
- double toDouble();
+ abstract int toInt();
+ abstract double toDouble();
- String toStringAsFixed(int fractionDigits);
- String toStringAsExponential(int fractionDigits);
- String toStringAsPrecision(int precision);
- String toRadixString(int radix);
+ abstract String toStringAsFixed(int fractionDigits);
+ abstract String toStringAsExponential(int fractionDigits);
+ abstract String toStringAsPrecision(int precision);
+ abstract String toRadixString(int radix);
}

Powered by Google App Engine
This is Rietveld 408576698