Slava Pestov 2008-10-23 05:28:04 -05:00
parent 885adc8dc9
commit 95eb0f696b
1 changed files with 5 additions and 3 deletions

View File

@ -43,17 +43,19 @@ C: <hi-tag-dispatch-engine> hi-tag-dispatch-engine
: num-hi-tags ( -- n ) num-types get num-tags get - ;
: hi-tag-number ( class -- n )
"type" word-prop num-tags get - ;
"type" word-prop ;
: hi-tag-quot ( -- quot )
\ hi-tag def>> num-tags get [ fixnum-fast ] curry compose ;
\ hi-tag def>> ;
M: hi-tag-dispatch-engine engine>quot
methods>> engines>quots* [ >r hi-tag-number r> ] assoc-map
methods>> engines>quots* [ >r "type" word-prop r> ] assoc-map
[
picker % hi-tag-quot % [
linear-dispatch-quot
] [
num-tags get , \ fixnum-fast ,
[ >r num-tags get - r> ] assoc-map
num-hi-tags direct-dispatch-quot
] if-small? %
] [ ] make ;