[erlang-questions] Maps branch and disclaimers

Björn-Egil Dahlberg egil@REDACTED
Wed Oct 30 14:51:27 CET 2013


On 2013-10-30 14:26, Chris King wrote:
> On Wed, 30 Oct 2013 08:40:44 -0400, Robert Virding 
> <robert.virding@REDACTED> wrote:
>
>     - I need functions:
>
>     first(Map) -> {Key,Value} | error.
>     last(Map) -> {Key,Value} | error.
>     next(Key, Map) -> {Key1,Value} | error.
>     prev(Key, Map) -> {Key1,Value} | error.
>
>     for stepping through maps. Have them return both key and value in
>     one go as it saves an explicit fetch and the extra cost is minimal.
>

Check. I'll amend the EEP.

>
> I don't get this use case.  Why do you need syntax support for a 
> key-value map where you don't know a priori what the keys and values 
> are?  Why don't dict() and friends suffice?
>
> To me this is akin to iterating through a record/tuple.

Actually these functions are needed, at least one is needed internally, 
I think.

It should be covered in comprehensions with Maps generators. Maps 
generators needs next(Key, Map).

But for small Maps and record like behaviour they are not needed. =)


>
>
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20131030/bcfb8dec/attachment.htm>


More information about the erlang-questions mailing list