Re: unique index

2018-03-22 Thread Dippo
@mashigan & @miran Ty guys, you both point me to tables and i also thought that tables would solve my problem. I thought that tableref would reference the content like record number. But it reference the whole table. The point is that i want to prevent to walk through the whole table to see if a

Re: unique index

2018-03-22 Thread miran
Maybe I'm misunderstanding the question, but to me this looks like a case where you would want to use [tables](https://nim-lang.org/docs/tables.html) instead of seq.

Re: unique index

2018-03-22 Thread mashingan
But maybe wrapped to `TableRef` is better I guess instead of seq if you need to have unique key

Re: unique index

2018-03-22 Thread mashingan
implement proc `==` and `contains` for you specialized type import sequtils type DataBuffer* = tuple key : string mytype : string value : string proc `==`(a, b: DataBuffer): bool = a.key == b.