mirror of
https://github.com/peklaiho/madlisp.git
synced 2024-11-22 21:35:03 +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
|
<?php
|
||||||
require('bootstrap.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) {
|
while (true) {
|
||||||
$input = readline('> ');
|
$input = readline('> ');
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$lisp->rep($input, $env);
|
$lisp->rep($input, $userEnv);
|
||||||
} catch (MadLisp\MadLispException $ex) {
|
} catch (MadLisp\MadLispException $ex) {
|
||||||
print('error: ' . $ex->getMessage());
|
print('error: ' . $ex->getMessage());
|
||||||
} catch (TypeError $ex) {
|
} catch (TypeError $ex) {
|
||||||
|
Loading…
Reference in New Issue
Block a user