The fasl-loader interns gensyms by default now.
This commit is contained in:
parent
b9a369197a
commit
158980aeea
BIN
bin/ikarus
BIN
bin/ikarus
Binary file not shown.
|
@ -310,16 +310,11 @@ static ikp do_read(ikpcb* pcb, fasl_port* p){
|
|||
char x = fasl_read_byte(p);
|
||||
return byte_to_scheme_char(x);
|
||||
}
|
||||
else if(c == 'G'){ /* G is for gensym */
|
||||
else if(c == 'G'){
|
||||
/* G is for gensym */
|
||||
ikp pretty = do_read(pcb, p);
|
||||
ikp unique = do_read(pcb, p);
|
||||
ikp sym = ik_alloc(pcb, align(symbol_size)) + symbol_tag;
|
||||
ref(sym, off_symbol_string) = pretty;
|
||||
ref(sym, off_symbol_ustring) = unique;
|
||||
ref(sym, off_symbol_value) = unbound_object;
|
||||
ref(sym, off_symbol_system_value) = unbound_object;
|
||||
ref(sym, off_symbol_plist) = null_object;
|
||||
ref(sym, off_symbol_system_plist) = null_object;
|
||||
ikp sym = ikrt_strings_to_gensym(pretty, unique, pcb);
|
||||
if(put_mark_index){
|
||||
p->marks[put_mark_index] = sym;
|
||||
}
|
||||
|
|
|
@ -78,21 +78,21 @@ intern_string(ikp str, ikp st, ikpcb* pcb){
|
|||
return sym;
|
||||
}
|
||||
|
||||
ikp
|
||||
ikrt_intern_unique_string(ikp ustr, ikp st, ikpcb* pcb){
|
||||
static ikp
|
||||
intern_unique_string(ikp str, ikp ustr, ikp st, ikpcb* pcb){
|
||||
int h = compute_hash(ustr);
|
||||
int idx = h & (unfix(ref(st, off_vector_length)) - 1);
|
||||
ikp bckt = ref(st, off_vector_data + idx*wordsize);
|
||||
ikp b = bckt;
|
||||
while(b){
|
||||
ikp sym = ref(b, off_car);
|
||||
ikp sym_str = ref(sym, off_symbol_ustring);
|
||||
if(strings_eqp(sym_str, ustr)){
|
||||
ikp sym_ustr = ref(sym, off_symbol_ustring);
|
||||
if(strings_eqp(sym_ustr, ustr)){
|
||||
return sym;
|
||||
}
|
||||
b = ref(b, off_cdr);
|
||||
}
|
||||
ikp sym = ik_make_symbol(false_object, ustr, pcb);
|
||||
ikp sym = ik_make_symbol(str, ustr, pcb);
|
||||
b = ik_alloc(pcb, pair_size) + pair_tag;
|
||||
ref(b, off_car) = sym;
|
||||
ref(b, off_cdr) = bckt;
|
||||
|
@ -148,13 +148,13 @@ ik_intern_string(ikp str, ikpcb* pcb){
|
|||
}
|
||||
|
||||
ikp
|
||||
ikrt_string_to_gensym(ikp str, ikpcb* pcb){
|
||||
ikrt_strings_to_gensym(ikp str, ikp ustr, ikpcb* pcb){
|
||||
ikp st = pcb->gensym_table;
|
||||
if(st == 0){
|
||||
st = make_symbol_table(pcb);
|
||||
pcb->gensym_table = st;
|
||||
}
|
||||
return intern_string(str, st, pcb);
|
||||
return intern_unique_string(str, ustr, st, pcb);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -162,6 +162,7 @@ void ik_print(ikp x);
|
|||
void ik_fprint(FILE*, ikp x);
|
||||
|
||||
ikp ikrt_string_to_symbol(ikp, ikpcb*);
|
||||
ikp ikrt_strings_to_gensym(ikp, ikp, ikpcb*);
|
||||
|
||||
ikp ik_cstring_to_symbol(char*, ikpcb*);
|
||||
|
||||
|
|
BIN
src/ikarus.boot
BIN
src/ikarus.boot
Binary file not shown.
Loading…
Reference in New Issue