mirror of
https://github.com/kanaka/mal.git
synced 2024-11-10 12:47:45 +03:00
e0188ffe5b
- hash-map equality is related to #161.
29 lines
421 B
Matlab
29 lines
421 B
Matlab
function step0_repl(varargin), main(varargin), end
|
|
|
|
% read
|
|
function ret = READ(str)
|
|
ret = str;
|
|
end
|
|
|
|
% eval
|
|
function ret = EVAL(ast, env)
|
|
ret = ast;
|
|
end
|
|
|
|
% print
|
|
function ret = PRINT(ast)
|
|
ret = ast;
|
|
end
|
|
|
|
% REPL
|
|
function ret = rep(str, env)
|
|
ret = PRINT(EVAL(READ(str), env));
|
|
end
|
|
|
|
function main(args)
|
|
while (true)
|
|
line = input('user> ', 's');
|
|
fprintf('%s\n', rep(line, ''));
|
|
end
|
|
end
|