madlisp/repl.php

18 lines
284 B
PHP
Raw Normal View History

2020-05-26 08:43:59 +00:00
<?php
2020-05-28 04:55:58 +00:00
require('bootstrap.php');
2020-05-27 09:27:47 +00:00
$env = ml_get_env();
2020-05-28 04:55:58 +00:00
$lisp = new MadLisp\Lisp();
2020-05-26 08:43:59 +00:00
while (true) {
$input = readline('> ');
try {
2020-05-28 04:55:58 +00:00
$lisp->rep($input, $env);
2020-05-26 08:43:59 +00:00
} catch (MadLispException $ex) {
print('error: ' . $ex->getMessage());
}
print(PHP_EOL);
}