Great, this works: 
    
    
    var dispatcher = @[PresentModeA[type(s)], PresentModeB[type(s)]]
    

what doesn't work though is if the implementations of PresentMode_A/B() are 
then expanded separately for other types: 
    
    
    proc PresentModeA*[T:string|seq[byte]](d: T) = ...
    proc PresentModeA*(d: bool) = ...
    

the error in main being: Error: cannot instantiate: 
'PresentModeA[type(some_bool_var)]'

But that would be stretching it I suppose. So I'm happy with the single 
implementation, as long as I remember the limitation.

Thanks again.

Reply via email to