aboutsummaryrefslogtreecommitdiff
path: root/matlab/core.m
diff options
context:
space:
mode:
authorJoel Martin <github@martintribe.org>2015-02-08 19:23:49 -0600
committerJoel Martin <github@martintribe.org>2015-02-08 23:51:45 -0600
commitc3023f2642064bb416bc6b817ab5ea80fec29fce (patch)
treedfaf85ae10920e89f5cd2c6f8e6ea758f76fff30 /matlab/core.m
parent9831bce71071b1db9391ef77d450199c6bc76990 (diff)
downloadmal-c3023f2642064bb416bc6b817ab5ea80fec29fce.tar.gz
mal-c3023f2642064bb416bc6b817ab5ea80fec29fce.zip
matlab: step7, fix reader bug.
Diffstat (limited to 'matlab/core.m')
-rw-r--r--matlab/core.m11
1 files changed, 11 insertions, 0 deletions
diff --git a/matlab/core.m b/matlab/core.m
index fb6e456..4115b2c 100644
--- a/matlab/core.m
+++ b/matlab/core.m
@@ -23,6 +23,14 @@ classdef core
ret = types.nil;
end
+ function ret = concat(varargin)
+ if nargin == 0
+ ret = {};
+ else
+ ret = cat(2,varargin{:});
+ end
+ end
+
function n = ns()
n = containers.Map();
n('=') = @types.equal;
@@ -45,6 +53,9 @@ classdef core
n('list') = @(varargin) varargin;
n('list?') = @iscell;
+
+ n('cons') = @(a,b) [{a}, b];
+ n('concat') = @core.concat;
n('empty?') = @(a) length(a) == 0;
n('count') = @(a) length(a);
end