Hi - I am new to nim and it would be great of one of you could point me in the 
right direction.

I have many (>100) functions from a c library taking different combinations of 
parameter (int32, int64, float32, float64 and so on).

And I would like to come up with something like 
    
    
    prod add*[L,R,T](lhs: L, rhs: R) : T
     

(which does not work because T is not defined)

L and R could be every combination of int32, uint32, int64, uint64, float32, 
float64 and so on and writing all combinations be hand seems very impractical

T depends on L and R (e.g int32, int64 -> int64) and I can "calculate" T based 
on L and R at compile time if I could call a proc to generate the target type T 
- if you could point my to some concepts I could us or an example solving a 
similar case this would be fantastic.

Many thanks in advance!

Reply via email to