almost. g{T<:FloatingPoint}(a::Array{T}) if you want it restricted the
elements to subtypes of FloatingPoint.

2014-11-29 16:19 GMT-05:00 Petr Krysl <[email protected]>:

> You mean like this:
>
> function g{T}(a::Array{T})
>
>   show(a)
>
> end
>
> g(A)
>
>
> On Saturday, November 29, 2014 1:04:25 PM UTC-8, Andreas Noack wrote:
>>
>> You are welcome. It is explained better than I'm able to do here
>> http://julia.readthedocs.org/en/latest/manual/methods/#parametric-methods
>>
>> 2014-11-29 15:59 GMT-05:00 Petr Krysl <[email protected]>:
>>
>>> Thanks, I hear you guys.  These are the concepts, and Julia implements
>>> them: The two are concrete types, and hence cannot be derived from each
>>> other.
>>>
>>> But here it is: An array of floating-point numbers is an array of
>>> floating-point numbers.
>>>
>>> So how would you write the function so that it is Julia-style and works
>>> with any floating-point number?
>>>
>>> Thanks a lot,
>>>
>>> Petr
>>>
>>>>
>>>>
>>

Reply via email to