diff --git a/src/init.c b/src/init.c index b0042fb..6e6b106 100644 --- a/src/init.c +++ b/src/init.c @@ -454,7 +454,7 @@ int main( int argc, char *argv[] ) { &lisp_print ); bind_function( L"println", L"`(println stream)`: Print a new line character to `stream`, if specified, else to `*out*`.", - &lisp_println ); + &lisp_print ); bind_function( L"put!", L"", lisp_hashmap_put ); bind_function( L"put-all!", L"`(put-all! dest source)`: If `dest` is a namespace and is writable, copies all key-value pairs from `source` into `dest`.", diff --git a/src/io/print.c b/src/io/print.c index d9d2998..f5f80a5 100644 --- a/src/io/print.c +++ b/src/io/print.c @@ -350,6 +350,8 @@ lisp_println( struct stack_frame *frame, struct cons_pointer frame_pointer, output = pointer2cell( out_stream ).payload.stream.stream; println( output ); + + free( output ); } return NIL; diff --git a/src/memory/stack.c b/src/memory/stack.c index 6cc68a0..70c07f9 100644 --- a/src/memory/stack.c +++ b/src/memory/stack.c @@ -37,7 +37,7 @@ uint32_t stack_limit = 0; * because that way we can be sure the inc_ref happens! */ void set_reg( struct stack_frame *frame, int reg, struct cons_pointer value ) { - debug_printf( DEBUG_STACK, L"\tSetting register %d to ", reg ); + debug_printf( DEBUG_STACK, L"Setting register %d to ", reg ); debug_print_object( value, DEBUG_STACK ); debug_println( DEBUG_STACK ); dec_ref( frame->arg[reg] ); /* if there was anything in that slot @@ -63,10 +63,10 @@ struct stack_frame *get_stack_frame( struct cons_pointer pointer ) { if ( vectorpointp( pointer ) && stackframep( vso ) ) { result = ( struct stack_frame * ) &( vso->payload ); - // debug_printf( DEBUG_STACK, - // L"\nget_stack_frame: all good, returning %p\n", result ); + debug_printf( DEBUG_STACK, + L"get_stack_frame: all good, returning %p\n", result ); } else { - debug_print( L"\nget_stack_frame: fail, returning NULL\n", DEBUG_STACK ); + debug_print( L"get_stack_frame: fail, returning NULL\n", DEBUG_STACK ); } return result; @@ -97,8 +97,8 @@ struct cons_pointer in_make_empty_frame( struct cons_pointer previous, frame->depth = depth; /* - * The frame has already been cleared with memset in make_vso, but our - * NIL is not the same as C's NULL. + * clearing the frame with memset would probably be slightly quicker, but + * this is clear. */ frame->more = NIL; frame->function = NIL; @@ -133,8 +133,6 @@ struct cons_pointer make_empty_frame( struct cons_pointer previous ) { if ( stack_limit == 0 || stack_limit > depth ) { result = in_make_empty_frame( previous, depth ); } else { - debug_printf( DEBUG_STACK, - L"WARNING: Exceeded stack limit of %d\n", stack_limit); result = make_exception( c_string_to_lisp_string ( L"Stack limit exceeded." ), previous ); @@ -184,10 +182,9 @@ struct cons_pointer make_stack_frame( struct cons_pointer previous, result = val; break; } else { - debug_printf( DEBUG_STACK, L"\tSetting argument %d to ", + debug_printf( DEBUG_STACK, L"Setting argument %d to ", frame->args ); debug_print_object( cell.payload.cons.car, DEBUG_STACK ); - debug_print(L"\n", DEBUG_STACK); set_reg( frame, frame->args, val ); } @@ -328,7 +325,7 @@ void dump_frame( URL_FILE *output, struct cons_pointer frame_pointer ) { for ( int arg = 0; arg < frame->args; arg++ ) { struct cons_space_object cell = pointer2cell( frame->arg[arg] ); - url_fwprintf( output, L"\tArg %d:\t%4.4s\tcount: %10u\tvalue: ", + url_fwprintf( output, L"Arg %d:\t%4.4s\tcount: %10u\tvalue: ", arg, cell.tag.bytes, cell.count ); print( output, frame->arg[arg] ); diff --git a/src/ops/lispops.c b/src/ops/lispops.c index 914301d..393cc7b 100644 --- a/src/ops/lispops.c +++ b/src/ops/lispops.c @@ -1261,15 +1261,11 @@ struct cons_pointer eval_cond_clause( struct cons_pointer clause, env ) ); #ifdef DEBUG - debug_print( L"\n\t\tCond clause ", DEBUG_EVAL); - debug_print_object( clause, DEBUG_EVAL); - debug_print( L" succeeded; returning: ", DEBUG_EVAL ); + debug_print( L"\n\t\tclause succeeded; returning: ", DEBUG_EVAL ); debug_print_object( result, DEBUG_EVAL ); debug_println( DEBUG_EVAL ); } else { - debug_print( L"\n\t\tCond clause ", DEBUG_EVAL); - debug_print_object( clause, DEBUG_EVAL); - debug_print( L" failed.\n", DEBUG_EVAL ); + debug_print( L"\n\t\tclause failed.\n", DEBUG_EVAL ); #endif } } else { diff --git a/unit-tests/memberp.sh b/unit-tests/memberp.sh index a20a8b7..ff15ea4 100644 --- a/unit-tests/memberp.sh +++ b/unit-tests/memberp.sh @@ -3,7 +3,7 @@ result=0 expected='t' -output=`target/psse $1 <