Re: Prototypes Taylor Campbell 18 Apr 2003 03:24 UTC

On Thursday, April 10, 2003, at 02:20 AM, Michael Burschik wrote:

> The prototype of vector-find does not specify the function's return
> value,
> which should probably be "value".

Fixed.

> It might also be mentioned that the return
> value is ambiguous with regard to #f, which might be a vector element
> that
> satisfied the predicate, or signal that the end of the vector was
> reached
> without satisfying the predicate.

Can you think of a better thing to do in this case?

Or should there not even be a VECTOR-FIND (use VECTOR-INDEX and then
VECTOR-REF
instead)?

> The return value of vector-find-tail, on the other hand, should
> probably be
> "vector" instead of "value", as the reference implementation will
> return an
> empty vector in case no element satisfied the predicate.

Fixed.

> The prototype of vector-any should probably be (vector-any pred? vec1
> ...
> vecn), otherwise the variable "n" in the following discussion would be
> unbound. In many other functions defined in section 4.7, the arity of
> the
> predicate is not specified. Is this deliberate?

I've fixed a bunch of them.  I don't know if I got them all, so please
inform me
of any others you find.

> Regards
>
> Michael Burschik

Note: the 'Fixed.' comments indicate that I've fixed it and uploaded a
new copy,
but not to srfi.schemers.org -- see the updated copy at:

http://www.bloodandcoffee.net/campbell/html/srfi-43.html