@LeuGim - thanks for the clarification

@mratsim I didn't know about SomeReal thanks for pointing that out.

> By the way, I don't really understand your need but you can usually go very 
> far in Nim with just generics and overloading without to implement class-like 
> types.
> 
> If you need runtime polymorphism, don't forget to look into object variants 
> and methods (which are dispatched at runtime instead of compile-time).

I did look at object variants which are very interesting. In the end I think 
I'll probably end up writing using compile time parametric polymorphism with 
generics - but at the moment, I'm kind of feeling my way around the language to 
see what I can do with it. I'm now getting round to playing with generics. My 
experience of meta-programming comes mostly from D, Julia and even less C++, I 
have read type parameters, templates, and macros section in the manual and it 
certainly looks very flexible - I'll definitely have questions about it later.

Many thanks

Reply via email to