That's it.  Thanks!

On Wednesday, 21 May 2014 16:21:48 UTC-3, Mike Innes wrote:
>
> A quick search turns up isleaftype, which seems to do exactly the 
> opposite of what you want:
>
> isleaftype(AbstractArray) => false
> isleaftype(Array{Int, 2}) => true
>
> Hope that helps.
>
>
> On 21 May 2014 20:15, Stephen Chisholm <sbchi...@gmail.com 
> <javascript:>>wrote:
>
>> Is there a way to check if a given DataType is an abstract type?  I've 
>> come up with a crude method below but thought there should be a better way.
>>
>>
>> function isabstract(t::DataType)
>>     try
>>         t()
>>     catch exception
>>         return (typeof(exception) == ErrorException &&
>>                 string(exception.msg) == "type cannot be constructed")
>>     end
>>     return false
>> end
>>
>>
>> Cheers, Steve
>>
>
>

Reply via email to