Open
Description
I expect to be able to borrow the []
function for a distinct seq, but it appears not to be implemented. Either by doing this:
type MySeq* {.borrow: `[]`.} [T] = distinct seq[T]
let points = MySeq(@[ (x: 1, y: 2), (x: 5, y: 6) ])
echo points[0]
Or this:
type MySeq* {.borrow: `[]`.} [T] = distinct seq[T]
proc `[]`*[T](a: MySeq[T], x: int): T {.borrow.}
echo points[0]
Neither of those compile, though.
(See also this forum thread)
Activity