A newly updated dict module #267

merged 31 commits into from Apr 26, 2012

3 participants

Elixir member

This obsoletes #250 and can be fast-forwarded in the upstream:

git remote add alco git://github.com/alco/elixir.git
git fetch alco
git checkout master   # ensure you're on master
git merge --ff-only alco/master
alco added some commits Apr 13, 2012
@alco alco New GenDict protocol 6a35725
@alco alco New Dict module wrapping Erlang.dict f84dd2e
@alco alco Add tests for GenDict.merge 8cf4997
@alco alco Implement GenDict.extend and GenDict.update e7d0344
@alco alco Implement Dict.from_dict 136a2f5
@alco alco Use capitalized name for Dict instances 3bb3e51
@alco alco Implement Orddict 9be17e3
@alco alco Remove duplication and cleanup the code 8b9413b
@alco alco Add a small optimization in `put` invocations ca34986
@alco alco Clean up the code a bit more 71d0c78
@alco alco Add tests for size, update and empty 4cce433
@alco alco Additional tests for Dict.new and Orddict.new b8545c5
@alco alco Fix assert_raises usage 7b78e19
@alco alco Implement arbitrary term access for List
This also makes the Keyword module obsolete since we can now use
@alco alco Document the usage of tricky ref d783b65
@alco alco Implement PDict.to_list
This is going to be useful in Enum
@alco alco Generalize the Enum module to support dicts d79ba92
@alco alco Add `ordered_iterator` function
Some of the Enum's functions assume an ordering is defined for the collection.
Since ordering is not defined for all types, using `ordered_iterator`
allows us to raise a runtime error for those types.
@alco alco Review the docs for Enum functions bf28eb0
@alco alco Rename Dict -> HashDict and encapsulate it in a record 5e92c8e
@alco alco Fix issues with Enum protocol for dicts ad8113a
@alco alco Revert "Implement arbitrary term access for List"
This reverts commit d859057ae93558bdd4a31e31c53bc359c5d41a44.

elixir-lang#250 (comment)
@alco alco Keep Orddict.values in order 51d1f12
@alco alco Test that Enum.join does not work for dicts 25f5fa6
@alco alco Fix compiler warnings with default argument a90a654
@alco alco Use the new defprotocol for Dict ff4c159
@alco alco assert_raises -> assert_raise 327c0a4
@alco alco Reimplement the Enum iterator 707d2c8
@alco alco Comment out one assert in enum_test 82b81c6
@alco alco Remove the paragraph about custom iterator e261aab
@alco alco Merge branch 'new-dict-module'

I resolved all the conflicts and replaced assert_equal with assert ==.

This pull request passes (merged e109ae0 into b620b2e).

@josevalim josevalim merged commit 5ca6266 into elixir-lang:master Apr 26, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment