summaryrefslogtreecommitdiff
path: root/sources/examples/maps.scala
diff options
context:
space:
mode:
Diffstat (limited to 'sources/examples/maps.scala')
-rw-r--r--sources/examples/maps.scala8
1 files changed, 5 insertions, 3 deletions
diff --git a/sources/examples/maps.scala b/sources/examples/maps.scala
index a5b2348f95..0defd89a81 100644
--- a/sources/examples/maps.scala
+++ b/sources/examples/maps.scala
@@ -21,7 +21,7 @@ object maps {
val empty: AlgMap = Empty();
private case class
- Empty() extends AlgMap {},
+ Empty(),
Node(key: kt, value: vt, l: map, r: map) extends AlgMap {}
trait AlgMap extends Map {
@@ -111,7 +111,7 @@ object maps {
class MutMap(key: kt, value: vt) extends Map {
val k = key;
var v = value;
- var l = empty, r = empty;
+ var l, r = empty;
def apply(key: kt): vt =
if (this == empty) null
@@ -152,7 +152,9 @@ object maps {
}
class Date(y: Int, m: Int, d: Int) with Ord[Date] {
- def year = y, month = m, day = d;
+ def year = y;
+ def month = m;
+ def day = d;
def <(that: Date): Boolean = {
(year < that.year) ||