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

Re: Any and Every... (was Re: Eval)



"KELLEHER,KEVIN (Non-HP-Roseville,ex1)" <kevin_kelleher@non.hp.com> writes:

> "Any" is not the union of all types,
> but one member from the group of all types.
> "Every" is all members.
> 
> If you are looking for "any", you are looking for one.
> 
> If you are looking for "every", you are looking for many.
> 
> The phrases "the union of all types" and "the intersection
> of all types" do not make sense.  You have to have more
> than one group to have unions and intersections,
> but there is only one group: types.

Sure they do.  A `type' *is* a set (a set of all objects that `are' of
that particular type), so the `union' and `intersection' operations on
types makes sense.  (And in general, is what people mean when talking
about union and intersection types.)

So the `union' of all types would be a set that contains *everything*
(Russel's paradox notwithstanding), and any member of the
`intersection' of all types would be found in any other set.

Typically, though, one isn't considering abstract sets but those sets
that are representable in the type calculus of the language.  In these
cases, the `union of all types' is interesting because it can
represent any object, and the `intersection of all types' is
interesting because an instance of it can be assigned to anything.