assignment 2 done
authorMart Lubbers <mart@martlubbers.net>
Tue, 10 Feb 2015 09:11:36 +0000 (10:11 +0100)
committerMart Lubbers <mart@martlubbers.net>
Tue, 10 Feb 2015 09:11:36 +0000 (10:11 +0100)
week2/mart/StdT.icl
week2/mart/StdTTest [new file with mode: 0755]
week2/mart/TupleOverloadingTest [new file with mode: 0755]
week2/mart/VectorOverloadingTest [new file with mode: 0755]

index e49da8a..01bee7d 100644 (file)
@@ -7,7 +7,7 @@ import StdEnv
 instance ==    T where\r
        == a b = a.m == b.m && a.s == b.s\r
 instance <     T where\r
-       < a b = a.m < b.m || a.s < b.s\r
+       < a b = a.m < b.m || a.s == b.s && a.s < b.s\r
 \r
 instance zero  T where\r
        zero = {m=zero, s=zero}\r
@@ -31,8 +31,5 @@ instance toString     T where
 \r
 instance fromString    T where\r
        fromString a\r
-       | a.[size a - 3] == ':' = {m = toInt (a % (0, (size a) - 4)), s = toInt (a % ((size a) - 3, size a))}\r
+       | a.[size a - 3] == ':' = {m = toInt (a % (0, (size a) - 4)), s = toInt (a % ((size a) - 2, size a))}\r
        | otherwise = zero\r
-\r
-Start :: T\r
-Start = fromString "12:34"\r
diff --git a/week2/mart/StdTTest b/week2/mart/StdTTest
new file mode 100755 (executable)
index 0000000..e4b92d6
Binary files /dev/null and b/week2/mart/StdTTest differ
diff --git a/week2/mart/TupleOverloadingTest b/week2/mart/TupleOverloadingTest
new file mode 100755 (executable)
index 0000000..33d33e1
Binary files /dev/null and b/week2/mart/TupleOverloadingTest differ
diff --git a/week2/mart/VectorOverloadingTest b/week2/mart/VectorOverloadingTest
new file mode 100755 (executable)
index 0000000..abf16db
Binary files /dev/null and b/week2/mart/VectorOverloadingTest differ