All types do have Any as a parent.

It is clear that many people are confused about what covariance, contravariance 
and invariance mean in computer science. As such, I very strongly encourage 
everyone who isn't sure that they understand Julia's type system to read 
through the wikipedia article on covariance and contravariance: 
http://en.wikipedia.org/wiki/Covariance_and_contravariance_%28computer_science%29

Perhaps the Julia manual should have a "prerequisites" section that lists all 
of the concepts that readers are assumed to already understand.

 -- John

On Nov 26, 2014, at 7:27 PM, K Leo <cnbiz...@gmail.com> wrote:

> I ran into similar mental difficulty regarding whether type Any is a superset 
> of any other types.  I did not find anything to read, but simply accepted the 
> fact through painstaking experiments.
> 
> I think the word "Any" here is confusing.  The English definition of it means 
> that it ought to include any types.  Perhaps we should seek other word to 
> define this type.  Word like "Mixed" might be more appropriate for this?
> 
> On 2014年11月27日 08:17, Patrick O'Leary wrote:
>> 
>> You've hit type invariance. In Julia, parametric types are invariant--that 
>> is, Dict{ASCIIString,Float64} is not a subtype of Dict{ASCIIString,Any}.
>> 
>> For more information on why we use invariant parametric types, search the 
>> list for "parametric invariant" or similar; there have been a few 
>> discussions on the topic.
>> 
>> Patrick
> 

Reply via email to