This allows the inherited tuples, including block-checksum-state, to be
treated like the normal disposable tuples, instead of imitating only part
of the interface.
: checksum-file ( path checksum -- value )
[ binary <file-reader> ] dip checksum-stream ;
-TUPLE: checksum-state checksum { bytes byte-vector } ;
+TUPLE: checksum-state < disposable
+ checksum
+ { bytes byte-vector } ;
-M: checksum-state dispose drop ;
+M: checksum-state dispose* drop ;
M: checksum-state clone
call-next-method
[ clone ] change-bytes ;
: new-checksum-state ( class -- checksum-state )
- new BV{ } clone >>bytes ;
+ new-disposable BV{ } clone >>bytes ;
GENERIC: initialize-checksum-state ( checksum -- checksum-state )
GENERIC#: add-checksum-bytes 1 ( checksum-state data -- checksum-state )