From c3023f2642064bb416bc6b817ab5ea80fec29fce Mon Sep 17 00:00:00 2001 From: Joel Martin Date: Sun, 8 Feb 2015 19:23:49 -0600 Subject: matlab: step7, fix reader bug. --- matlab/core.m | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'matlab/core.m') 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 -- cgit v1.2.3