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

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



Hi!

Maybe I am not using my terms correctly, so let me try again 
(someone please hit me if I should take this offline).

On Tuesday, January 8, 2002, at 10:30 , Christopher Barber wrote:
>> Is there also a type "every" that is the intersection of all types?
>> If so, what are it's values? Is "every" isomorphic to "NULL" or
>> something similar, i.e. it can be assigned to everything else but
>> nothing can be assigned to it? Or does it not make sense at all?
>
> At least in Curl, the intersection of all types is a type 'void' 
> which has
> no values; i.e., there is no value that is assignable to any type.
> Of course, there may be some languages in which the intersection of all
> types is non-empty.

I think Eiffel has a "not really existing type" (almost wrote 
"virtual type" but that might be confusing) called "ALL" which 
defined as the subclass of all other classes in a system.

Therefore it has all the methods of all the classes and "closes" 
the inheritance hierarchy at the bottom. Would you even call that 
an "intersection of all class types" or rather a "hodgepodge type"? 
Maybe my problem is the exact definition of "union type" and 
"intersection type"?

For "ALL" my characterization seems to apply, i.e. "in theory" you 
can assign a value of type "ALL" to every variable, but you can 
never assign any value of another type to a variable of type "ALL".

BTW, I've been carrying around this "question" or "confusion" for 
at least three years now, always promising myself to sit down 
someday and work it out. Today it just struck me as a good idea to 
post it here instead. :-)

Peter
--
Peter H. Froehlich []->[!]<-[] http://nil.ics.uci.edu/~phf/
OpenPGP: D465 CBDD D9D2 0D77 C5AF  353E C86C 2AD9 A6E2 309E