Re: string-cursor? predicate
John Cowan 22 Apr 2016 21:10 UTC
Per Bothner scripsit:
> On implementations where cursor == index, should string-cursor? return
> #t or #f given an integer? I assume #t.
I assume you mean a non-negative exact integer. I can see a case for
allowing the implementation to return either #t or #f in such cases,
but probably returning #t is more useful. So the function means "Can
obj be a string cursor?"
In particular, where indexes are non-negative character offsets and
cursors are non-positive byte offsets, then 0 is both an index and
a cursor, and #t is the most sensible value.
--
John Cowan http://www.ccil.org/~cowan xxxxxx@ccil.org
The first thing you learn in a lawin' family is that there ain't
no definite answers to anything. --Calpurnia in To Kill A Mockingbird