Work on the 'member?' bug - (issue #8) -- which turns out to be assoc/interned.
Progress has been made, but this is not fixed.
This commit is contained in:
parent
7d0ce67373
commit
dc5cac0bd8
4 changed files with 52 additions and 10 deletions
|
|
@ -919,17 +919,26 @@ lisp_internedp( struct stack_frame *frame, struct cons_pointer frame_pointer,
|
|||
struct cons_pointer c_keys( struct cons_pointer store ) {
|
||||
struct cons_pointer result = NIL;
|
||||
|
||||
if ( hashmapp( store ) ) {
|
||||
result = hashmap_keys( store );
|
||||
} else if ( consp( store ) ) {
|
||||
for ( struct cons_pointer c = store; !nilp( c ); c = c_cdr( c ) ) {
|
||||
result = make_cons( c_car( c ), result );
|
||||
if ( consp( store ) ) {
|
||||
for ( struct cons_pointer pair = c_car( store ); !nilp( pair );
|
||||
pair = c_car( store ) ) {
|
||||
if ( consp( pair ) ) {
|
||||
result = make_cons( c_car( pair), result);
|
||||
} else if ( hashmapp( pair ) ) {
|
||||
result=c_append( hashmap_keys( pair), result);
|
||||
}
|
||||
|
||||
store = c_cdr( store );
|
||||
}
|
||||
} else if ( hashmapp( store ) ) {
|
||||
result = hashmap_keys( store );
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
struct cons_pointer lisp_keys( struct stack_frame *frame,
|
||||
struct cons_pointer frame_pointer,
|
||||
struct cons_pointer env ) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue