Very small progress.
This commit is contained in:
parent
637d78fb1b
commit
7cd2cbf785
|
@ -80,8 +80,8 @@ bool equal( struct cons_pointer a, struct cons_pointer b ) {
|
||||||
&& ( equal( cell_a->payload.string.cdr,
|
&& ( equal( cell_a->payload.string.cdr,
|
||||||
cell_b->payload.string.cdr )
|
cell_b->payload.string.cdr )
|
||||||
|| ( end_of_string( cell_a->payload.string.cdr )
|
|| ( end_of_string( cell_a->payload.string.cdr )
|
||||||
&& end_of_string( cell_b->payload.string.
|
&& end_of_string( cell_b->payload.
|
||||||
cdr ) ) );
|
string.cdr ) ) );
|
||||||
break;
|
break;
|
||||||
case INTEGERTV:
|
case INTEGERTV:
|
||||||
result =
|
result =
|
||||||
|
|
|
@ -103,6 +103,7 @@ int main( int argc, char *argv[] ) {
|
||||||
bind_function( "*", &lisp_multiply );
|
bind_function( "*", &lisp_multiply );
|
||||||
bind_function( "-", &lisp_subtract );
|
bind_function( "-", &lisp_subtract );
|
||||||
bind_function( "/", &lisp_divide );
|
bind_function( "/", &lisp_divide );
|
||||||
|
bind_function( "=", &lisp_equal );
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* primitive special forms
|
* primitive special forms
|
||||||
|
|
|
@ -390,8 +390,10 @@ lisp_eval( struct stack_frame *frame, struct cons_pointer env ) {
|
||||||
internedp( frame->arg[0], env );
|
internedp( frame->arg[0], env );
|
||||||
if ( nilp( canonical ) ) {
|
if ( nilp( canonical ) ) {
|
||||||
struct cons_pointer message =
|
struct cons_pointer message =
|
||||||
|
c_cons(
|
||||||
c_string_to_lisp_string
|
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 );
|
result = lisp_throw( message, frame );
|
||||||
} else {
|
} else {
|
||||||
result = c_assoc( canonical, env );
|
result = c_assoc( canonical, env );
|
||||||
|
|
|
@ -132,8 +132,8 @@ void print( FILE * output, struct cons_pointer pointer ) {
|
||||||
case LAMBDATV:
|
case LAMBDATV:
|
||||||
print( output, make_cons( c_string_to_lisp_symbol( "lambda" ),
|
print( output, make_cons( c_string_to_lisp_symbol( "lambda" ),
|
||||||
make_cons( cell.payload.lambda.args,
|
make_cons( cell.payload.lambda.args,
|
||||||
cell.payload.
|
cell.payload.lambda.
|
||||||
lambda.body ) ) );
|
body ) ) );
|
||||||
break;
|
break;
|
||||||
case NILTV:
|
case NILTV:
|
||||||
fwprintf( output, L"nil" );
|
fwprintf( output, L"nil" );
|
||||||
|
@ -141,8 +141,8 @@ void print( FILE * output, struct cons_pointer pointer ) {
|
||||||
case NLAMBDATV:
|
case NLAMBDATV:
|
||||||
print( output, make_cons( c_string_to_lisp_symbol( "nlambda" ),
|
print( output, make_cons( c_string_to_lisp_symbol( "nlambda" ),
|
||||||
make_cons( cell.payload.lambda.args,
|
make_cons( cell.payload.lambda.args,
|
||||||
cell.payload.
|
cell.payload.lambda.
|
||||||
lambda.body ) ) );
|
body ) ) );
|
||||||
break;
|
break;
|
||||||
case READTV:
|
case READTV:
|
||||||
fwprintf( output, L"(Input stream)" );
|
fwprintf( output, L"(Input stream)" );
|
||||||
|
|
Loading…
Reference in a new issue