Very small progress.

This commit is contained in:
Simon Brooke 2018-12-20 11:01:13 +00:00
parent 637d78fb1b
commit 7cd2cbf785
4 changed files with 10 additions and 7 deletions

View file

@ -80,8 +80,8 @@ bool equal( struct cons_pointer a, struct cons_pointer b ) {
&& ( equal( cell_a->payload.string.cdr,
cell_b->payload.string.cdr )
|| ( end_of_string( cell_a->payload.string.cdr )
&& end_of_string( cell_b->payload.string.
cdr ) ) );
&& end_of_string( cell_b->payload.
string.cdr ) ) );
break;
case INTEGERTV:
result =

View file

@ -103,6 +103,7 @@ int main( int argc, char *argv[] ) {
bind_function( "*", &lisp_multiply );
bind_function( "-", &lisp_subtract );
bind_function( "/", &lisp_divide );
bind_function( "=", &lisp_equal );
/*
* primitive special forms

View file

@ -390,8 +390,10 @@ lisp_eval( struct stack_frame *frame, struct cons_pointer env ) {
internedp( frame->arg[0], env );
if ( nilp( canonical ) ) {
struct cons_pointer message =
c_cons(
c_string_to_lisp_string
( "Attempt to take value of unbound symbol." );
( "Attempt to take value of unbound symbol." ),
frame->arg[0]);
result = lisp_throw( message, frame );
} else {
result = c_assoc( canonical, env );

View file

@ -132,8 +132,8 @@ void print( FILE * output, struct cons_pointer pointer ) {
case LAMBDATV:
print( output, make_cons( c_string_to_lisp_symbol( "lambda" ),
make_cons( cell.payload.lambda.args,
cell.payload.
lambda.body ) ) );
cell.payload.lambda.
body ) ) );
break;
case NILTV:
fwprintf( output, L"nil" );
@ -141,8 +141,8 @@ void print( FILE * output, struct cons_pointer pointer ) {
case NLAMBDATV:
print( output, make_cons( c_string_to_lisp_symbol( "nlambda" ),
make_cons( cell.payload.lambda.args,
cell.payload.
lambda.body ) ) );
cell.payload.lambda.
body ) ) );
break;
case READTV:
fwprintf( output, L"(Input stream)" );