1
0
Fork 0

Introduce key-bytes symbol and with-key

master
Michael Raitza 2020-02-09 01:53:52 +01:00
parent b5dd6e1065
commit 5a7d699b3b
1 changed files with 8 additions and 0 deletions

View File

@ -44,8 +44,16 @@ TUPLE: cb-node < node byte# bits ;
! ** Insertion
! Explain...
! Keep the byte sequence of the current key in =key-bytes= and provide a working
! environment for it with =with-key=.
SYMBOL: key-bytes
: with-key ( key quot -- )
[ key-bytes ] dip with-variable ; inline
DEFER: cb-set
! TODO Rewrite with =with-key=.
: cb-insert ( value key node -- node taller? created? )
2dup [ byte#>> ] [ bits>> ] bi
[ swap get-byte-at ] dip key-side [