All good, but I just can't see it. If I have:
julia> abstract T
julia> type S <: T; end
julia> type R <: T; end
and I ask "What are the subtypes of T?" I would expect to get back either
[S,R]
or
[R,S]
or even
Set{R,S}
because each of those things have cardinality 2. Because there are 2
subsets of T. If instead I were to get back the value
Union{R,S}
then that would be answering the question "What are the subtypes of T?"
with the answer "This SINGLE type whose values are all the same as the
original type." That I **can't** understand (and would be surprised if Jeff
would), but if everyone else thinks it makes sense, no worries! We can
disagree. Our expectations might differ on this.
I thought it was a fun thought experiment to begin with....
Thanks for the discussion.
On Monday, January 4, 2016 at 5:48:53 PM UTC-8, Ismael Venegas Castell贸
wrote:
>
> After watching the video: *Jeff Bezanzon: Julia - The base language,
> future directions and speculations
> <https://www.youtube.com/watch?v=xUP3cSKb8sI> *as Scott mentions,
> returning a Union type indeed starts to make sense to me.
>
>
> El s谩bado, 2 de enero de 2016, 13:09:43 (UTC-6), Scott Jones escribi贸:
>>
>> Going by Jeff's JuliaCon 2015 talk, and the code in
>> examples/JuliaTypes.jl, I think returning the subtypes as a set of types
>> (which is the same as a union of types) makes perfect sense.
>> I'm hoping that this change does make it into 0.5, I think it does clean
>> up a lot of bad corner cases in the current type system (which Jeff also
>> mentioned in his talk)
>>
>> On Tuesday, December 29, 2015 at 5:45:51 PM UTC-5, Ray Toal wrote:
>>>
>>> But maybe I'm not understanding this correctly? Was it suggested that a
>>> type union be the result of the subtypes method? I don't think that makes
>>> sense.... The subtypes of a type is a set of types, not a type (even if
>>> that type were the union of all the subtypes). It strikes me as a little
>>> odd, but I may have misheard, or there might me an interpretation of it
>>> that I haven't thought about.
>>>
>>> On Tuesday, December 29, 2015 at 7:02:41 AM UTC-8, Scott Jones wrote:
>>>>
>>>> Yes! 馃槃 I was hoping that Jeff had implemented something super fast for
>>>> type unions.
>>>
>>>