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

*To*: Jens Axel Søgaard <jensaxel@xxxxxxxxxxxx>*Subject*: Re: transitivity does not imply type-checking*From*: Matthias Radestock <matthias@xxxxxxxxxx>*Date*: Sun, 20 Nov 2005 09:37:19 +0000*Cc*: srfi-67@xxxxxxxxxxxxxxxxx*Delivered-to*: srfi-67@xxxxxxxxxxxxxxxxx*In-reply-to*: <437F6A1F.60304@xxxxxxxxxxxx> ( Jens Axel Søgaard's message of "Sat, 19 Nov 2005 19:08:31 +0100")*References*: <lyhda8zy4e.fsf@xxxxxxxxxxxxxxxx> <437F6A1F.60304@xxxxxxxxxxxx>*User-agent*: Gnus/5.1007 (Gnus v5.10.7) XEmacs/21.4.17 (Jumbo Shrimp, linux)

Jens Axel Søgaard <jensaxel@xxxxxxxxxxxx> writes: > R5RS states that = must me transitive, if one interprets this > to mean that > > (= o1 o2 o3) > > and > > (let ([t1 o1] [t2 o2] [t3 o3]) > (non-short-circuting-and (= t1 t2) (= t2 t3))) > > should behave the same way on all objects o1, o2 and o3, then > type checking all arguments is needed. That is a very unusual interpretation of transitivity. The ordinary definition of transitivity is (x P y) and (y P z) => (x P z) We can extend the domain of = etc to all values (NB: R5RS allows that, but certainly does not require it). For P to still be a predicate it must return #t/#f, and nothing else. I think you are trying to extend the range to #t/#f/all-errors, but then P is no longer a predicate and hence the usual transitivity rule has nothing to say about that situation. Furthermore, even with the above rule in place it is possible to construct predicates that do not perform type checking on all args, as I demonstrated by the example in my previous post. FWIW, R5RS provides a much more direct hint regarding type checking of args.(*) In section 1.3.2 it states "it is an error for a procedure to be passed an argument that the procedure is not explicitly specified to handle" Since section 6.2.5 defines the domain of numerical predicates to be real numbers (and complex numbers for =), it is clear that "it is an error" to pass any arguments outside that domain. However, as is usual in R5RS, there is a way around that. First of all, section 1.3.2 also states that "Implementations may extend a procedure's domain of definition to include such arguments.", and that "it is an error" refers to error situations that "implementations are not required to detect". Hence really anything can happen when you pass an argument of the wrong type to a predicate. Matthias (*) Thanks to Anton van Straaten for pointing this out.

**Follow-Ups**:**Re: transitivity does not imply type-checking***From:*Jens Axel Søgaard

**References**:**transitivity does not imply type-checking***From:*Matthias Radestock

**Re: transitivity does not imply type-checking***From:*Jens Axel Søgaard

- Prev by Date:
**Re: transitivity does not imply type-checking** - Next by Date:
**Re: transitivity does not imply type-checking** - Previous by thread:
**Re: transitivity does not imply type-checking** - Next by thread:
**Re: transitivity does not imply type-checking** - Index(es):