I think that the following code should work (sorry if there is any typo): 
    
    
    type Stack[T] = concept c
      c.push(T)
      c.pop(var T) is bool # or something like this (this is: var t:T; 
c.pop(t); )
    
    proc f(x: Stack[int]) = ...
    

but the following should fail to compile: 
    
    
    type Stack[T] = concept c
      c.push(T)
      c.pop(var T) is bool # or something like this (this is: var t:T; 
c.pop(t); )
    
    proc f[T](x: Stack[T]): T = ...
    

because `c.push(T)` should not infer the type. It is not unique, and one type 
could implement both `Stack[int]` and `Stack[float]`.

>From the proposed manual it seems like you are suggesting that the second 
>example should also work. Am I right in this? What do you think?

Thanks,
    Peter

Reply via email to