parent
f3a26bc02e
commit
b6480aebd5
53 changed files with 590 additions and 520 deletions
|
|
@ -272,7 +272,7 @@ bool equal_map_map( struct cons_pointer a, struct cons_pointer b ) {
|
|||
|
||||
for ( struct cons_pointer i = keys_a; !nilp( i ); i = c_cdr( i ) ) {
|
||||
struct cons_pointer key = c_car( i );
|
||||
if ( !equal
|
||||
if ( !c_equal
|
||||
( hashmap_get( a, key, false ),
|
||||
hashmap_get( b, key, false ) ) ) {
|
||||
result = false;
|
||||
|
|
@ -331,7 +331,7 @@ bool equal_vector_vector( struct cons_pointer a, struct cons_pointer b ) {
|
|||
* Deep, and thus expensive, equality: true if these two objects have
|
||||
* identical structure, else false.
|
||||
*/
|
||||
bool equal( struct cons_pointer a, struct cons_pointer b ) {
|
||||
bool c_equal( struct cons_pointer a, struct cons_pointer b ) {
|
||||
debug_print( L"\nequal: ", DEBUG_EQUAL );
|
||||
debug_print_object( a, DEBUG_EQUAL );
|
||||
debug_print( L" = ", DEBUG_EQUAL );
|
||||
|
|
@ -353,8 +353,8 @@ bool equal( struct cons_pointer a, struct cons_pointer b ) {
|
|||
* structures can be of indefinite extent. It *must* be done by
|
||||
* iteration (and even that is problematic) */
|
||||
result =
|
||||
equal( cell_a->payload.cons.car, cell_b->payload.cons.car )
|
||||
&& equal( cell_a->payload.cons.cdr,
|
||||
c_equal( cell_a->payload.cons.car, cell_b->payload.cons.car )
|
||||
&& c_equal( cell_a->payload.cons.cdr,
|
||||
cell_b->payload.cons.cdr );
|
||||
break;
|
||||
case KEYTV:
|
||||
|
|
@ -401,7 +401,7 @@ bool equal( struct cons_pointer a, struct cons_pointer b ) {
|
|||
* isn't sufficient. So we recurse at least once. */
|
||||
|
||||
result = ( wcsncmp( a_buff, b_buff, i ) == 0 )
|
||||
&& equal( c_cdr( a ), c_cdr( b ) );
|
||||
&& c_equal( c_cdr( a ), c_cdr( b ) );
|
||||
}
|
||||
break;
|
||||
case VECTORPOINTTV:
|
||||
|
|
|
|||
|
|
@ -31,6 +31,6 @@ bool eq( struct cons_pointer a, struct cons_pointer b );
|
|||
* Deep, and thus expensive, equality: true if these two objects have
|
||||
* identical structure, else false.
|
||||
*/
|
||||
bool equal( struct cons_pointer a, struct cons_pointer b );
|
||||
bool c_equal( struct cons_pointer a, struct cons_pointer b );
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -334,7 +334,7 @@ struct cons_pointer search_store( struct cons_pointer key,
|
|||
|
||||
switch ( get_tag_value( entry_ptr ) ) {
|
||||
case CONSTV:
|
||||
if ( equal( key, c_car( entry_ptr ) ) ) {
|
||||
if ( c_equal( key, c_car( entry_ptr ) ) ) {
|
||||
result =
|
||||
return_key ? c_car( entry_ptr )
|
||||
: c_cdr( entry_ptr );
|
||||
|
|
@ -441,7 +441,7 @@ struct cons_pointer internedp( struct cons_pointer key,
|
|||
for ( struct cons_pointer pair = c_car( store );
|
||||
eq( result, NIL ) && !nilp( pair ); pair = c_car( store ) ) {
|
||||
if ( consp( pair ) ) {
|
||||
if ( equal( c_car( pair ), key ) ) {
|
||||
if ( c_equal( c_car( pair ), key ) ) {
|
||||
// yes, this should be `eq`, but if symbols are correctly
|
||||
// interned this will work efficiently, and if not it will
|
||||
// still work.
|
||||
|
|
|
|||
|
|
@ -987,7 +987,7 @@ lisp_equal( struct stack_frame *frame, struct cons_pointer frame_pointer,
|
|||
if ( frame->args > 1 ) {
|
||||
for ( int b = 1; ( truep( result ) ) && ( b < frame->args ); b++ ) {
|
||||
result =
|
||||
equal( frame->arg[0], fetch_arg( frame, b ) ) ? TRUE : NIL;
|
||||
c_equal( frame->arg[0], fetch_arg( frame, b ) ) ? TRUE : NIL;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue