aboutsummaryrefslogtreecommitdiff
path: root/matlab/+types
diff options
context:
space:
mode:
authorJoel Martin <github@martintribe.org>2015-02-08 13:18:08 -0600
committerJoel Martin <github@martintribe.org>2015-02-08 23:51:22 -0600
commit6d12affa8bc91a6662e8d4bdcc66a6963b77e947 (patch)
tree644d5a482081600faafc09e679fb1006796de659 /matlab/+types
parentd6624158bdf41e047ad8d0a9942238dc80649901 (diff)
downloadmal-6d12affa8bc91a6662e8d4bdcc66a6963b77e947.tar.gz
mal-6d12affa8bc91a6662e8d4bdcc66a6963b77e947.zip
matlab: all step4 except optional.
Diffstat (limited to 'matlab/+types')
-rw-r--r--matlab/+types/Nil.m8
-rw-r--r--matlab/+types/Symbol.m3
2 files changed, 11 insertions, 0 deletions
diff --git a/matlab/+types/Nil.m b/matlab/+types/Nil.m
index d7573f0..7aa8130 100644
--- a/matlab/+types/Nil.m
+++ b/matlab/+types/Nil.m
@@ -1,2 +1,10 @@
classdef Nil
+ methods
+ function len = length(obj)
+ len = 0;
+ end
+ function ret = eq(a,b)
+ ret = strcmp(class(b),'types.Nil');
+ end
+ end
end
diff --git a/matlab/+types/Symbol.m b/matlab/+types/Symbol.m
index 1a06037..5da6b7a 100644
--- a/matlab/+types/Symbol.m
+++ b/matlab/+types/Symbol.m
@@ -6,5 +6,8 @@ classdef Symbol
function sym = Symbol(name)
sym.name = name;
end
+ function ret = eq(a,b)
+ ret = strcmp(a.name, b.name);
+ end
end
end