elixir-lang/elixir — pull request #1461 by madlep (2013-07-20 11:14:58+00:00)
Title: reverse @__behaviour_docs__

Behaviour callback docs are top accumulated as module attributes, so are therefore stored internally in reverse order to how they were added.

However, they weren't being reversed again when being accessed, so ended up backwards.

Fix is to just reverse them when we get them back out to put them in the right order.

This is used by ex_doc, and callbacks are listed backwards otherwise (e.g. see http://elixir-lang.org/docs/stable/Dict.html )

Raised initially as https://github.com/elixir-lang/ex_doc/pull/47 , but made fix here instead as recommended by @josevalim