Eigenstate: myrddin-dev mailing list

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RFC: comparable and hashable traits


Hello myrddin-dev,

This is a proposal to change how hash tables are used. The idea is to add two
new traits to the core language: comparable and hashable. This allows to remove
the functions that are passed to mkht, removes a lot of duplicated code by just
providing implementations for @a[:], @a::(integral,numeric) and @a#. As a side
effect of this, the code becomes cleaner and more readable.

It's important to note that this is a first approach, as there are some places
where further changes can be made (e.g., replacing sleq with cmp), and some
things to be done yet (modifying the tests and providing docs). Feedback will
be appreciated.

Cheers.


Follow-Ups:
[PATCH 1/2] Add comparable and hashable traitsLucas Gabriel Vuotto <lvuotto92@xxxxxxxxx>
[PATCH 2/2] Use new traits to implement hash tablesLucas Gabriel Vuotto <lvuotto92@xxxxxxxxx>
Re: RFC: comparable and hashable traitsOri Bernstein <ori@xxxxxxxxxxxxxx>
Re: RFC: comparable and hashable traitsOri Bernstein <ori@xxxxxxxxxxxxxx>