[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: More minor issues

On Thu, Oct 16, 2003 at 04:31:32AM -0700, Bradd W. Szonye wrote:
> The explanation of * and % is confusing. The SRFI states:
>     When * is encountered in the definitions below, it is implied that
>     the asterisk is replaced with a function for the specific collection
>     and each of the collection's supertypes for which the procedure is
>     defined. For example, if we had a 'list' flexible sequence
>     collection, the functions list-contains?,
>     flexible-sequence-contains?, sequence-contains?, bag-contains? must
>     all exist, but collection-contains? does not.
> But the *-methods seem to be defined for the supertype, not the subtype.
> Given that, the above explanation is confusing. Wouldn't it be better to
> state:
>     When * is encountered in the definitions below, it means that the
>     function exists for the named collection and all of its subtypes.
>     For example, all bags and subtypes of bag have a *-contains?
>     function: bag-contains?, sequence-contains?, and even
>     list-contains?.

That would be more clear, yes.

> polymorphic. I think they are, but the SRFI isn't entirely clear. If so,
> please clarify; for example:
>     Each *-function may be applied to the specific type named or to any
>     of its subtypes. For example, bag-contains? can find a value in a
>     sequence, flexible-sequence, or list.

Yes, they are supposed to be polymorphic.  This is stated at the end
of the text in the Procedures section:

           Encountering * as a function argument
           indicates that the argument must be a collection
           of the type the function is defined for, or any sub-type. 

> Unrelated to this: The *-remove functions state that they "return two
> values." I had to check the reference implementation to confirm that
> this means "returns using VALUES." Perhaps the function prototype should
> read:
>     procedure: *-remove-left![!] * => (VALUES % value)

I think the current form is sufficient, but I'll add a sentence 
clarifiying that multiple items on the right of => imply the return of 
multiple values.


Attachment: pgp5DT7bIKa9N.pgp
Description: PGP signature