mirror of
https://github.com/peklaiho/madlisp.git
synced 2024-11-22 13:24:46 +00:00
new env for user definitions
This commit is contained in:
parent
cf9af2b5fe
commit
90654396b9
7
repl.php
7
repl.php
@ -1,13 +1,16 @@
|
||||
<?php
|
||||
require('bootstrap.php');
|
||||
|
||||
list($lisp, $env) = ml_get_lisp();
|
||||
list($lisp, $rootEnv) = ml_get_lisp();
|
||||
|
||||
// Create new env for user definitions
|
||||
$userEnv = new MadLisp\Env($rootEnv);
|
||||
|
||||
while (true) {
|
||||
$input = readline('> ');
|
||||
|
||||
try {
|
||||
$lisp->rep($input, $env);
|
||||
$lisp->rep($input, $userEnv);
|
||||
} catch (MadLisp\MadLispException $ex) {
|
||||
print('error: ' . $ex->getMessage());
|
||||
} catch (TypeError $ex) {
|
||||
|
Loading…
Reference in New Issue
Block a user