summaryrefslogtreecommitdiff
path: root/week2/mart
diff options
context:
space:
mode:
Diffstat (limited to 'week2/mart')
-rw-r--r--week2/mart/StdT.icl7
-rwxr-xr-xweek2/mart/StdTTestbin0 -> 149912 bytes
-rwxr-xr-xweek2/mart/TupleOverloadingTestbin0 -> 163304 bytes
-rwxr-xr-xweek2/mart/VectorOverloadingTestbin0 -> 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
new file mode 100755
index 0000000..e4b92d6
--- /dev/null
+++ b/week2/mart/StdTTest
Binary files differ
diff --git a/week2/mart/TupleOverloadingTest b/week2/mart/TupleOverloadingTest
new file mode 100755
index 0000000..33d33e1
--- /dev/null
+++ b/week2/mart/TupleOverloadingTest
Binary files differ
diff --git a/week2/mart/VectorOverloadingTest b/week2/mart/VectorOverloadingTest
new file mode 100755
index 0000000..abf16db
--- /dev/null
+++ b/week2/mart/VectorOverloadingTest
Binary files differ