[erlang-questions] Maps

Robert Virding robert.virding@REDACTED
Wed May 15 12:28:25 CEST 2013


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

> From: "Dan Gudmundsson" <dgud@REDACTED>

> Robert Virding
> > Use only matching

> We would like to but we believe we can not do that because we can't
> output a defined order,
> i.e. you can not sort 1.0 and 1.
> We would need to define a new term order in erlang and we need to
> introduce something
> like <:<, >:> =:< and >:=.

I personally think this would be a good idea to introduce anyway as I think today's comparison ops are not good. So: 

- introduce a new set of comparison operators that do not convert integers to floats on comparison 
- fix the term ordering for this. This is actually very easy, just make integers < floats, we are comparing *terms* 
- modify the libraries which use comparisons to use the new ops 
- use them in maps if we are going to have sorted maps 

I know we can't make the existing comparison ops only work numbers, but it would be nice. 

Robert 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20130515/7b9c59eb/attachment.htm>


More information about the erlang-questions mailing list