Forget struct slot accessors when structs classes are redefined

db4
Doug Coleman 2011-10-03 17:12:49 -07:00
parent c14f217300
commit 25c64d12e8
1 changed files with 16 additions and 6 deletions

View File

@ -321,13 +321,23 @@ ERROR: invalid-struct-slot token ;
c-type c-type-boxed-class
dup \ byte-array = [ drop \ c-ptr ] when ;
: forget-struct-accessors ( class -- )
dup "c-type" word-prop fields>> [
name>>
[ reader-word ?lookup-method forget ]
[ writer-word ?lookup-method forget ] 2bi
] with each ;
M: struct-class reset-class
[ call-next-method ]
[
[ forget-struct-slot-values-method ]
[ forget-clone-method ] bi
]
[ { "c-type" "layout" "struct-size" } reset-props ] tri ;
{
[ forget-struct-accessors ]
[
[ forget-struct-slot-values-method ]
[ forget-clone-method ] bi
]
[ { "c-type" "layout" "struct-size" } reset-props ]
[ call-next-method ]
} cleave ;
SYMBOL: bits: