madlisp/repl.php
2020-06-02 09:51:21 +07:00

19 lines
377 B
PHP

<?php
require('bootstrap.php');
list($lisp, $env) = ml_get_lisp();
while (true) {
$input = readline('> ');
try {
$lisp->rep($input, $env);
} catch (MadLisp\MadLispException $ex) {
print('error: ' . $ex->getMessage());
} catch (TypeError $ex) {
print('error: invalid argument type: ' . $ex->getMessage());
}
print(PHP_EOL);
}