From 1307c65e9494da9f046c1e02e10da0c020e9ac55 Mon Sep 17 00:00:00 2001 From: Simon Brooke Date: Fri, 7 Dec 2018 06:32:02 +0000 Subject: [PATCH] And the answer was, eval is a function, not a special form. --- src/init.c | 14 +++++++------- unit-tests/eval-quote.sh | 12 ------------ 2 files changed, 7 insertions(+), 19 deletions(-) delete mode 100644 unit-tests/eval-quote.sh diff --git a/src/init.c b/src/init.c index d267dec..51c4170 100644 --- a/src/init.c +++ b/src/init.c @@ -1,7 +1,7 @@ /** * init.c * - * Start up and initialise the environement - just enough to get working + * Start up and initialise the environement - just enough to get working * and (ultimately) hand off to the executive. * * @@ -37,7 +37,7 @@ void bind_special( char *name, struct cons_pointer ( *executable ) int main( int argc, char *argv[] ) { /* - * attempt to set wide character acceptance on all streams + * attempt to set wide character acceptance on all streams */ fwide( stdin, 1 ); fwide( stdout, 1 ); @@ -69,14 +69,14 @@ int main( int argc, char *argv[] ) { initialise_cons_pages( ); /* - * privileged variables (keywords) + * privileged variables (keywords) */ deep_bind( c_string_to_lisp_symbol( "nil" ), NIL ); deep_bind( c_string_to_lisp_symbol( "t" ), TRUE ); /* - * primitive function operations + * primitive function operations */ bind_function( "add", &lisp_add ); bind_function( "apply", &lisp_apply ); @@ -98,14 +98,14 @@ int main( int argc, char *argv[] ) { bind_function( "-", &lisp_subtract ); /* - * primitive special forms + * primitive special forms */ bind_special( "cond", &lisp_cond ); - bind_special( "eval", &lisp_eval ); + bind_function( "eval", &lisp_eval ); bind_special( "quote", &lisp_quote ); - /* bind the oblist last, at this stage. Something clever needs to be done + /* bind the oblist last, at this stage. Something clever needs to be done * here and I'm not sure what it is. */ deep_bind( c_string_to_lisp_symbol( "oblist" ), oblist ); diff --git a/unit-tests/eval-quote.sh b/unit-tests/eval-quote.sh deleted file mode 100644 index eea16ec..0000000 --- a/unit-tests/eval-quote.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -expected='5' -actual=`echo "(eval '(add 2 3))" | target/psse 2> /dev/null | head -2 | tail -1` - -if [ "${expected}" = "${actual}" ] -then - echo "OK" -else - echo "Fail: expected '${expected}', got '${actual}'" - exit 1 -fi