diff --git a/cb/cb.factor b/cb/cb.factor index 3ad0957..0bc0833 100644 --- a/cb/cb.factor +++ b/cb/cb.factor @@ -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 [