Hi guys,

Learning Nim as a game programming language. Been following along from a 
distance for a while, but decided to dive in. Really loving it.

I am a bit puzzled by the following behavior:
    
    
    proc f(x: SomeNumber) = discard
    
    f(1.1) # OK
    f(1)   # OK
    
    proc g(x: SomeNumber = 1'f64) = discard
    
    g(1.1) # OK
    g(1)   # Error
    

Why would the default parameter have any effect on the parameter's type in this 
case? Is there some technical or design decision that makes this so? Is there 
some technique or idiomatic way of dealing with this situation?

Note that this is a distillation of basically an entire API where I would 
ideally be able to supply defaults to many functions with type class parameters.

Thanks, _c

Reply via email to