the forth-83 spec defines word expect follows:
expect addr +n -- m,83 receive characters , store each memory. transfer begins @ addr proceeding towards higher addresses 1 byte per character until either "return" received or until +n characters have been transferred. no more +n characters stored. "return" not stored memory. no characters received or transferred if +n zero. characters received , stored memory displayed, "return" displaying space. so, reads to, not including, return or eol.
but without terminator, , without returning number of characters read, how know string ends?
leo brodie refers word accept, similar, has signature ( addr +n -- +m ). return number of characters read, i'd expect. that's not in spec...
the standard defines span, tells number of characters read.
also note, in new standard function obsolete, use accept instead.
Comments
Post a Comment