: (read) ( n quot -- n string )
over 0 <string> [
[
- slip over
- [ swapd set-nth-unsafe f ] [ 3drop t ] if
- ] 2curry find-integer
+ over [ swapd set-nth-unsafe f ] [ 3drop t ] if
+ ] curry compose find-integer
] keep ; inline
: finish-read ( n string -- string/f )
} cond ; inline
M: decoder stream-read
- tuck >decoder< [ decode-char ] 2curry (read) finish-read fix-read ;
+ [ nip ] [ >decoder< [ decode-char ] 2curry (read) finish-read ] 2bi
+ fix-read ;
M: decoder stream-read-partial stream-read ;