Email list hosting service & mailing list manager

Comments on SRFI-1. Harvey J. Stein (04 Jan 1999 10:35 UTC)
Comments on SRFI-1. Shriram Krishnamurthi (04 Jan 1999 15:41 UTC)
Comments on SRFI-1. Shriram Krishnamurthi (04 Jan 1999 15:56 UTC)
Re: Comments on SRFI-1. hjstein@xxxxxx (04 Jan 1999 16:05 UTC)
Re: Comments on SRFI-1. Shriram Krishnamurthi (04 Jan 1999 16:24 UTC)
Re: Comments on SRFI-1. Dave Mason (04 Jan 1999 16:30 UTC)

Re: Comments on SRFI-1. Dave Mason 04 Jan 1999 16:29 UTC

>>>>> On Mon, 4 Jan 1999 10:24:52 -0600 (CST), Shriram Krishnamurthi <xxxxxx@cs.rice.edu> said:

> Harvey J. Stein wrote:
>> Maybe better than list-length>= would be (list-ref-with-default l n
>> default-value, which returns default-vaule if (>= (length l) n).

> That doesn't mean the programmer will know what value to provide --
> indeed, this increases the possibility of error.  To be safe, in the
> worst case, he would have to scan the entire list to make sure the
> default-value isn't in it (remember, Scheme doesn't have a
> generative struct mechanism either), or tack a token onto every
> value already in the list.  Clearly, neither of these is viable.

(let* ((sentinel (cons 0 0))
       (value (list-ref-with-default l n sentinal)))
    (if (eq? value sentinel)
       ...not found...
       ...found...))

But I agree that continuations are cleaner.

../Dave