Replace set-cell! with set-car!

Set-cell was just a wrapper on set-car anyway, but it was failing to record a mutation, which would cause problems later on for the GC. By using set-car directly we avoid GC issues and simplify the runtime code a bit.
This commit is contained in:
Justin Ethier 2015-04-15 13:30:28 -04:00
parent 03df6405e6
commit abac04c58e
2 changed files with 1 additions and 5 deletions

View file

@ -487,7 +487,7 @@
((eq? p 'cons) "make_cons") ((eq? p 'cons) "make_cons")
((eq? p 'cell) "make_cell") ((eq? p 'cell) "make_cell")
((eq? p 'cell-get) "cell_get") ((eq? p 'cell-get) "cell_get")
((eq? p 'set-cell!) "cell_set") ((eq? p 'set-cell!) "Cyc_set_car")
((eq? p 'set-global!) "global_set") ((eq? p 'set-global!) "global_set")
(else (else
(error "unhandled primitive: " p)))) (error "unhandled primitive: " p))))

View file

@ -20,10 +20,6 @@ static const object Cyc_EOF = &__EOF;
static object cell_get(object cell){ static object cell_get(object cell){
return car(cell); return car(cell);
} }
static object cell_set(object cell, object value){
((list) cell)->cons_car = value;
return cell;
}
#define global_set(glo,value) (glo=value) #define global_set(glo,value) (glo=value)