Ah yes, sorry, I was coming from a more convoluted example, similar to 
Milan's use case. Suppose you have:

~~~
abstract Dice end

immutable RedDice <: Dice end
immutable BlueDice <: Dice end
~~~

I overminimalized my example :)



On Thursday, March 10, 2016 at 5:02:11 PM UTC-5, DNF wrote:
>
> What is the purpose of the H type parameter here? You can just use
>
> > takedecision(::Type{Dice}) = println("throw a dice")
> > takedecision(Dice)
> throw a dice
>
> That would remove the objection of 'ugliness'.
>
>
> immutable Dice end
>> immutable Coin end
>>
>> takedecision{H <: Dice}(::Type{H})=println("throw a dice")
>> takedecision{H <: Coin}(::Type{H})=println("flip a coin")
>> makedecision(::Dice)=println("throw a dice")
>> makedecision(::Coin)=println("flip a coin")
>>
>> takedecision(Dice)
>> takedecision(Coin)
>> makedecision(Dice())
>> makedecision(Coin())
>>
>

Reply via email to