No, string being an openarray does not seem to be mentioned in the manual.

That example might not work perhaps because of the excessive generic arguments? 
Try this:
    
    
    proc encrypter*(data: array or seq or string, key: string): typeof(data) = 
...
    
    
    Run

This uses something called [implicit 
generics](https://nim-lang.org/docs/manual.html#generics-implicit-generics) and 
is analogous to
    
    
    proc encrypter*[T: array or seq or string](data: T, key: string): 
typeof(data) = ...
    
    
    Run

You can simplify the signature further with
    
    
    proc encrypter*[T: array or seq or string](data: T, key: string): T = ...
    
    
    Run

Reply via email to