I think you can get what you want with

foo{T}(::V{5,T}) = print("hello I'm spechial")

On Sat, 19 Dec 2015 at 10:45 Kristoffer Carlsson <[email protected]>
wrote:

> Found some discussion here:
> https://github.com/JuliaLang/julia/issues/7311#issuecomment-46563315
>
>
> On Saturday, December 19, 2015 at 11:43:39 AM UTC+1, Kristoffer Carlsson
> wrote:
>>
>> Slightly related.
>>
>> Are there any issues regarding explicit specialization of parameterized
>> methods (on value)?
>>
>> immutable V{N, T}
>>        a::NTuple{N,T}
>>  end
>>
>> foo{N, T} = print("hello")
>>
>> v = V{5, Float64}((1.0,2.0,3.0,4.0,5.0))
>>
>> foo(v)
>> # hello
>>
>> # Explicit specialization, nope:
>>
>> foo{5, T}(::V{5,T}) = print("hello I'm spechial")
>> # ERROR: syntax: malformed type parameter list
>>
>>
>>
>> On Friday, December 18, 2015 at 10:36:42 PM UTC+1, Kristoffer Carlsson
>> wrote:
>>>
>>> Thanks for the link.
>>
>>

Reply via email to