Found and fixed a bug I did not previously know about in println.

This commit is contained in:
Simon Brooke 2026-03-18 12:22:12 +00:00
parent 54a99b6796
commit 69b199fecd
4 changed files with 4 additions and 5 deletions

View file

@ -454,7 +454,7 @@ int main( int argc, char *argv[] ) {
&lisp_print ); &lisp_print );
bind_function( L"println", bind_function( L"println",
L"`(println stream)`: Print a new line character to `stream`, if specified, else to `*out*`.", L"`(println stream)`: Print a new line character to `stream`, if specified, else to `*out*`.",
&lisp_print ); &lisp_println );
bind_function( L"put!", L"", lisp_hashmap_put ); bind_function( L"put!", L"", lisp_hashmap_put );
bind_function( L"put-all!", 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`.", L"`(put-all! dest source)`: If `dest` is a namespace and is writable, copies all key-value pairs from `source` into `dest`.",

View file

@ -350,8 +350,6 @@ lisp_println( struct stack_frame *frame, struct cons_pointer frame_pointer,
output = pointer2cell( out_stream ).payload.stream.stream; output = pointer2cell( out_stream ).payload.stream.stream;
println( output ); println( output );
free( output );
} }
return NIL; return NIL;

View file

@ -97,8 +97,8 @@ struct cons_pointer in_make_empty_frame( struct cons_pointer previous,
frame->depth = depth; frame->depth = depth;
/* /*
* clearing the frame with memset would probably be slightly quicker, but * The frame has already been cleared with memset in make_vso, but our
* this is clear. * NIL is not the same as C's NULL.
*/ */
frame->more = NIL; frame->more = NIL;
frame->function = NIL; frame->function = NIL;

View file

@ -60,6 +60,7 @@ output=`target/psse $1 <<EOF
(set! member? (set! member?
(lambda (lambda
(item collection) (item collection)
(progn (print (list "In member; collection is:" collection)) (println))
(cond (cond
((nil? collection) nil) ((nil? collection) nil)
((= item (car collection)) t) ((= item (car collection)) t)