why :ets.first and :ets.last return the same value?

37 views
Skip to first unread message

zak9...@gmail.com

unread,
Feb 25, 2015, 11:36:05 PM2/25/15
to elixir-l...@googlegroups.com
iex(1)> :ets.new(Test, [:named_table])
iex(2)> :ets.insert(Test, [{:foo, 1, 2}, {:bar, 1, 2}])

In the above example both :ets.first(Test) and :ets.last(Test) return :bar. why?


Saša Jurić

unread,
Feb 26, 2015, 1:58:45 AM2/26/15
to elixir-l...@googlegroups.com

Returns the last key Key according to Erlang term order in the table Tab of the ordered_set type. If the table is of any other type, the function is synonymous to first/2.
Reply all
Reply to author
Forward
0 new messages