diff options
author | Mart Lubbers | 2015-02-10 10:11:36 +0100 |
---|---|---|
committer | Mart Lubbers | 2015-02-10 10:11:36 +0100 |
commit | 91eeba3cb86ab7ed5156273655217b329ab0a0b2 (patch) | |
tree | 9d6286d9cb097500911f9a1d0be7bef891bc17fd | |
parent | week 2 almost finished (diff) |
assignment 2 done
-rw-r--r-- | week2/mart/StdT.icl | 7 | ||||
-rwxr-xr-x | week2/mart/StdTTest | bin | 0 -> 149912 bytes | |||
-rwxr-xr-x | week2/mart/TupleOverloadingTest | bin | 0 -> 163304 bytes | |||
-rwxr-xr-x | week2/mart/VectorOverloadingTest | bin | 0 -> 164752 bytes |
4 files changed, 2 insertions, 5 deletions
diff --git a/week2/mart/StdT.icl b/week2/mart/StdT.icl index e49da8a..01bee7d 100644 --- a/week2/mart/StdT.icl +++ b/week2/mart/StdT.icl @@ -7,7 +7,7 @@ import StdEnv instance == T where
== a b = a.m == b.m && a.s == b.s
instance < T where
- < a b = a.m < b.m || a.s < b.s
+ < a b = a.m < b.m || a.s == b.s && a.s < b.s
instance zero T where
zero = {m=zero, s=zero}
@@ -31,8 +31,5 @@ instance toString T where instance fromString T where
fromString a
- | a.[size a - 3] == ':' = {m = toInt (a % (0, (size a) - 4)), s = toInt (a % ((size a) - 3, size a))}
+ | a.[size a - 3] == ':' = {m = toInt (a % (0, (size a) - 4)), s = toInt (a % ((size a) - 2, size a))}
| otherwise = zero
-
-Start :: T
-Start = fromString "12:34"
diff --git a/week2/mart/StdTTest b/week2/mart/StdTTest Binary files differnew file mode 100755 index 0000000..e4b92d6 --- /dev/null +++ b/week2/mart/StdTTest diff --git a/week2/mart/TupleOverloadingTest b/week2/mart/TupleOverloadingTest Binary files differnew file mode 100755 index 0000000..33d33e1 --- /dev/null +++ b/week2/mart/TupleOverloadingTest diff --git a/week2/mart/VectorOverloadingTest b/week2/mart/VectorOverloadingTest Binary files differnew file mode 100755 index 0000000..abf16db --- /dev/null +++ b/week2/mart/VectorOverloadingTest |