diff --git a/src/conspage.c b/src/conspage.c index 3413091..efb9f91 100644 --- a/src/conspage.c +++ b/src/conspage.c @@ -167,7 +167,7 @@ struct cons_pointer allocate_cell( char *tag ) { fprintf( stderr, "Allocated cell of type '%s' at %d, %d \n", tag, result.page, result.offset ); - dump_object( stderr, result ); + // dump_object( stderr, result ); } else { fprintf( stderr, "WARNING: Allocating non-free cell!" ); } diff --git a/src/consspaceobject.c b/src/consspaceobject.c index 19171ad..35b8e5f 100644 --- a/src/consspaceobject.c +++ b/src/consspaceobject.c @@ -91,7 +91,7 @@ void dump_object( FILE * output, struct cons_pointer pointer ) { cell.payload.real.value ); } else if ( check_tag( pointer, STRINGTAG ) ) { fwprintf( output, - L"String cell: character '%1c' (%1d) next at page %2d offset %3d\n", + L"\t\tString cell: character '%1c' (%1d) next at page %2d offset %3d\n", cell.payload.string.character, cell.payload.string.cdr.page, cell.payload.string.cdr.offset ); @@ -150,9 +150,9 @@ make_string_like_thing( wint_t c, struct cons_pointer tail, char *tag ) { inc_ref( tail ); cell->payload.string.character = c; cell->payload.string.cdr.page = tail.page; + /* TODO: There's a problem here. Sometimes the offsets on + * strings are quite massively off. */ cell->payload.string.cdr.offset = tail.offset; - - dump_object( stderr, pointer); } else { fwprintf( stderr, L"Warning: only NIL and %s can be appended to %s\n", @@ -184,14 +184,6 @@ struct cons_pointer make_symbol( wint_t c, struct cons_pointer tail ) { */ struct cons_pointer make_special( struct cons_pointer src, struct cons_pointer ( *executable ) - - - - - - - - ( struct cons_pointer s_expr, struct cons_pointer env, struct stack_frame * frame ) ) { struct cons_pointer pointer = allocate_cell( SPECIALTAG ); diff --git a/src/init.c b/src/init.c index 3681e25..ff77551 100644 --- a/src/init.c +++ b/src/init.c @@ -28,14 +28,6 @@ void bind_function( char *name, struct cons_pointer ( *executable ) } void bind_special( char *name, struct cons_pointer ( *executable ) - - - - - - - - ( struct cons_pointer s_expr, struct cons_pointer env, struct stack_frame * frame ) ) { deep_bind( intern( c_string_to_lisp_symbol( name ), oblist ), @@ -101,10 +93,9 @@ int main( int argc, char *argv[] ) { bind_special( "quote", &lisp_quote ); repl( stdin, stdout, stderr, show_prompt ); - // print( stdout, lisp_eval( input, oblist, NULL)); if ( dump_at_end ) { - dump_pages( stderr ); + dump_pages( stdout ); } return ( 0 ); diff --git a/src/repl.c b/src/repl.c index 959104b..22c1571 100644 --- a/src/repl.c +++ b/src/repl.c @@ -34,6 +34,12 @@ repl( FILE * in_stream, FILE * out_stream, FILE * error_stream, if ( show_prompt ) { fwprintf( out_stream, L"\n-> " ); } + + /* OK, I think what's going wrong here is we're passing by + * value and I think we should be passing by reference. + * I'm not certain about that, and as it will be a really + * major change I'm going to think some more before making + * in */ // print( out_stream, lisp_eval(input, oblist, NULL)); print( out_stream, input ); fwprintf( out_stream, L"\n" ); diff --git a/unit-tests/integer-allocation.sh b/unit-tests/integer-allocation.sh index cc811b8..5d07d90 100644 --- a/unit-tests/integer-allocation.sh +++ b/unit-tests/integer-allocation.sh @@ -2,7 +2,7 @@ value=354 expected="Integer cell: value ${value}" -echo ${value} | target/psse 2>&1 | grep "${expected}" > /dev/null +echo ${value} | target/psse -d 2>&1 | grep "${expected}" > /dev/null if [ $? -eq 0 ] then diff --git a/unit-tests/string-allocation.sh b/unit-tests/string-allocation.sh index 5f503fc..3039897 100644 --- a/unit-tests/string-allocation.sh +++ b/unit-tests/string-allocation.sh @@ -2,7 +2,7 @@ value='"Fred"' expected="String cell: character 'F'" -echo ${value} | target/psse 2>&1 | grep "${expected}" > /dev/null +echo ${value} | target/psse -d 2>&1 | grep "${expected}" > /dev/null if [ $? -eq 0 ] then