Email list hosting service & mailing list manager

string-cursor? predicate Takashi Kato (21 Apr 2016 20:32 UTC)
Re: string-cursor? predicate John Cowan (21 Apr 2016 20:37 UTC)
Re: string-cursor? predicate Takashi Kato (21 Apr 2016 20:54 UTC)
Re: string-cursor? predicate Alex Shinn (21 Apr 2016 20:54 UTC)

Re: string-cursor? predicate Alex Shinn 21 Apr 2016 20:54 UTC

On Fri, Apr 22, 2016 at 5:37 AM, John Cowan <xxxxxx@mercury.ccil.org> wrote:
> Takashi Kato scripsit:
>
>> I've just noticed there is no string-cursor? predicate. Since the SRFI
>> adds cursor type, I think it's better to have a predicate for it. Or
>> is there a reason why it's not there?
>
> Cursors don't necessarily belong to a disjoint type.  In Chibi they do,
> but they could also be implemented as negative exact integers or by some
> other means.

But cursors must be disjoint.  For your example:

(define (string-cursor? obj)
  (and (integer? obj) (exact? obj) (negative? obj))

--
Alex