$machine = new \SimpleLisp\LispMachine();
$machine->setState([
'param1' => 5,
'param2' => 1,
'param3' => 0,
]);
echo $machine->run('5'); //5
echo $machine->run('param1'); //5
echo $machine->run('(AND 1 0)'); //false
echo $machine->run('(AND param1 param2)'); //true
echo $machine->run('(defun fibonacci (n) (if (> n 1) (+ (fibonacci (- n 1)) (fibonacci (- n 2))) n)) (fibonacci 7)'); //13
-
Notifications
You must be signed in to change notification settings - Fork 0
alex-yashin/php-simple-lisp
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
No description, website, or topics provided.
Resources
Stars
Watchers
Forks
Packages 0
No packages published