Things working much better now. assoc works. Currently printing of

string-like-things does not work, but I suspect that's shallow.
This commit is contained in:
Simon Brooke 2026-04-18 15:44:14 +01:00
parent 02a4bc3e28
commit 9a0f186f29
13 changed files with 400 additions and 38 deletions

View file

@ -41,7 +41,7 @@ bool c_eq( struct pso_pointer a, struct pso_pointer b ) {
}
bool c_equal( struct pso_pointer a, struct pso_pointer b ) {
bool result = false;
bool result = true;
if ( c_eq( a, b ) ) {
result = true;
@ -66,15 +66,19 @@ bool c_equal( struct pso_pointer a, struct pso_pointer b ) {
case KEYTV:
case STRINGTV:
case SYMBOLTV:
while ( !nilp( a ) && !nilp( b ) ) {
while ( result && !nilp( a ) && !nilp( b ) ) {
if ( pointer_to_object( a )->payload.string.character ==
pointer_to_object( b )->payload.string.character ) {
a = c_cdr( a );
b = c_cdr( b );
} else {
result = false;
}
}
result = nilp( a ) && nilp( b );
result = result && nilp( a ) && nilp( b );
break;
default:
result = false;
}
}

View file

@ -47,7 +47,7 @@ void int_handler( int dummy ) {
/**
* Very simple read/eval/print loop for bootstrapping.
*/
void c_repl( ) {
void c_repl( bool show_prompt ) {
signal( SIGINT, int_handler );
debug_print( L"Entered repl\n", DEBUG_REPL, 0 );
@ -68,6 +68,9 @@ void c_repl( ) {
while ( readp( input_stream ) &&
!url_feof( stream_get_url_file( input_stream ) ) ) {
if ( show_prompt )
c_princ( c_assoc( lisp_io_prompt, env ), output_stream );
/* bottom of stack */
struct pso_pointer frame_pointer = make_frame( 1, nil, input_stream );