madlisp/repl.php

18 lines
287 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 10:10:00 +00:00
$lisp = ml_get_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-28 06:59:36 +00:00
} catch (MadLisp\MadLispException $ex) {
2020-05-26 08:43:59 +00:00
print('error: ' . $ex->getMessage());
}
print(PHP_EOL);
}