[erlang-patches] improved orddict performance

Robert Virding robert.virding@REDACTED
Tue Oct 8 18:24:06 CEST 2013


Normally I agree with you but in this case we decided that we should have an orddict which completely specified the internal representation. The whole point of orddict is that the internal structure is documented and can be relied on. So you *can* use it as a proplist if you want, or as a list of key-value options to a function. Re proplists I feel that the orddict API is cleaner. 

I personally wouldn't worry about compatibility if someone calls these functions with an improper list. But then again I have rarely worried about backwards compatibility. :-) 

Robert 

----- Original Message -----

> From: "Rich Neswold" <rich.neswold@REDACTED>
> To: "erlang patches" <erlang-patches@REDACTED>
> Sent: Friday, 4 October, 2013 1:26:02 PM
> Subject: Re: [erlang-patches] improved orddict performance

> On Fri, Oct 4, 2013 at 5:19 AM, Raimo Niskanen <
> raimo+erlang-patches@REDACTED > wrote:

> > On Thu, Oct 03, 2013 at 10:27:42PM -0500, Rich Neswold wrote:
> 
> > > Any code that uses the orddict API should not end up with an improper
> > > list.
> 
> > > Any code that passes an improper list to orddict should break.
> 

> > But in the case of orddict, it is actually documented to have a data
> > representation being an ordered list of key-value tuples.
> 

> > Therefore there is a possibility that someone has misused that knowledge
> > and
> > uses an improper ordered list of key-value tuples, which may not be
> > violating the documentation...
> 

> If the documentation exposes the implementation (which is not a good idea,
> either) as an ordered list of key-value tuples, then users shouldn't
> complain when it doesn't handle improper lists.

> --
> Rich

> _______________________________________________
> erlang-patches mailing list
> erlang-patches@REDACTED
> http://erlang.org/mailman/listinfo/erlang-patches
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-patches/attachments/20131008/a4f093f9/attachment.htm>


More information about the erlang-patches mailing list