Mar 6, 2008 at 6:12 PM
Edited Mar 6, 2008 at 6:18 PM
i tried to use the lisp interpreter build into Singularity, but whenever issue a command like lisp \trace (define X 2) or lisp (+ 2 3) the help text is printed where it states Usage: lisp
Am I missing something here, or does the lisp code have to be in a file? By the way, is there a build in basic editor to create scripts or textfiles?
- - - - - - - -
Mar 17, 2008 at 8:14 PM
"The code for the interpreter is in %SINGULARITY_ROOT%\Libraries\ProtoLisp\Interpreter.cs. print does not look for or seem to support primatives other than:
t, nil, cond, quote, define, lambda, defun, atom, eq, car, cdr, cons, +, -, *, /
The lisp interpreter was written as a warm up project... We have not used the interpreter for anything."
...so this is your head start; get busy! please post when you have PERL running.
Mar 18, 2008 at 1:08 AM
until then here's something to bootstrap your curiosity
lisp '(+ 1 2)'
Setting Strings to (+ 1 2)
lisp '((lambda (arg) (+ arg 1)) 5)'
Setting Strings to ((lambda (arg) (+ arg 1)) 5)
lisp '(cons (+ 1 2) (quote (4 5 6)))'
Setting Strings to (cons (+ 1 2) (quote (4 5 6)))
(3 4 5 6)
next i created a file
lisp '(defun shouldbe () (quote (should be)))
(cons (car (shouldbe)) (cons (quote not) (cdr (shouldbe))))'
built, ran, at the prompt:
Setting Strings to <...yadda...>
(should not be)
i would have to check to tell you how long your program parameter can get.
the first enhnacement should be to support recursive #include?
examine ...\base\Libraries\ProtoLisp\Interpreter.cs to see the list of (only 5) primitives
"cond", "quote", "define", "lambda", "defun"
(no "list", use "quote" instead of single quote, ...)