* added `==` for OrderedTable, CountTable and the *Ref types
* added missing documentation to all `==` procs
* fixed clear() for OrderedTables, which did not work because `var`
does not work well with `|`
* added tests
However, this fix won't take effect until a compiler bug (#4448) is fixed. Until then, the codebase functions identically to
how it did before this commit (calls to clear() fail to compile for Table/OrderedTable/CountTable as the argument is
immutable).
The record tuples used in CountData.data don't contain an 'hcode' member,
unlike Table and OrderedTable, causing the existing clearImpl() implementation
to break when attempting to assign to t.data[i].hcode.
* With previous code, the compiler deduced that equalsImpl may raise
a KeyError. While this could only actually happen in a nasty
multi-threaded environment, I fixed the code so that it will never happen.
Just in case as they are said not overloadable. No deprecation because this is during a PR: those procs didn't exist before.
Also update comment due to failed optimization attempt using copyMem() for POD datatypes.
Better bounds checking. Tried to make it and documentation comply with the conflicting style guides.
Added example of usage at the top of the module as well as warnings on usage.
Also fix the back() and internal englishOrdinal() proc from previous commit.
Added {.discardable.} pragma for .pop(), when calling only for it's side effects.
Sprinkled some unlikely() for optimization.
Some new tests reflecting those changes.
Now queues support indexing, front() and back() operations and pairs iteration.
Also modernized some of the code to use newer Nim features.
Added the "add()" alias to "enqueue()", per nim's conventions (also fits better with pop())
This fixes the (potential) multi-evaluation of the sequence parameter in
foldl() and foldr().
It also adds a foldl() version which gets a start parameter. This allows
for creating a result with a different type than the elements of the
sequence.