3 ms·
I keep coming back to it, and I really like it but wouldn't it be great if it had interfaces? I really want to restrict the generic type but there seems to be n
by egeozcan 12y ago
I keep coming back to it, and I really like it but wouldn't it be great if it had interfaces? I really want to restrict the generic type but there seems to be no way other than using templates[1].
[1]: https://github.com/Araq/Nim/blob/master/lib/pure/collections/lists.nim#L109 https://github.com/Araq/Nim/blob/master/lib/pure/collections...
- def- 12y agoUser defined type classes can be used for this, but they're still experimental: http://nim-lang.org/manual.html#user-defined-type-classes http://nim-lang.org/manual.html#user-defined-type-classes
- egeozcan 12y agoI can't believe how I missed that. Maybe this is added recently? Anyway, thank you very much!