Re: [q-lang-users] Query about Type Tests (Complex and Rational).
Brought to you by:
agraef
From: John C. <co...@cc...> - 2006-06-15 21:45:35
|
Albert Graef scripsit: > I don't think that this is a good idea. The other type checking > predicates isxyz for a type Xyz all follow the scheme that the predicate > is equivalent to the type guard, so iscomplex should follow that > principle, too (that wasn't the case previously, but previously there > was no Complex type and iscomplex was a semantic predicate). I'm not sure I see the utility of this. Granted that non-numeric types work this way, why should the numeric ones? I'd favor a scheme in which you use the guards for syntactic types and the isX predicates for semantic types. What can you do with iscomplex that you can't do with a type guard? Or if you think this is essential, how about going to a scheme in which isX means "is it the representation type" and "is_X_number" means "does it actually fit the model for that kind of number"? So iscomplex would be true only of objects of type Complex, but is_complex_number would be true of any number (except hypothetical quaternions and octonions to be added later). In particular, is_integral_number would be true of Floats with integer values. A less verbose naming scheme would be good, though. -- John Cowan http://ccil.org/~cowan co...@cc... [T]here is a Darwinian explanation for the refusal to accept Darwin. Given the very pessimistic conclusions about moral purpose to which his theory drives us, and given the importance of a sense of moral purpose in helping us cope with life, a refusal to believe Darwin's theory may have important survival value. --Ian Johnston |