[erlang-questions] some patterns in questions.

Andreas Schultz andreas.schultz@REDACTED
Fri Oct 26 12:03:45 CEST 2018


Benoit Chesneau <bchesneau@REDACTED> schrieb am Di., 23. Okt. 2018 um
14:51 Uhr:

> Hi all,
>
> I'm polishing an api for a library that will be used by a lot of
> consumers. It seems important for me to respect much of the current
> expectations of Erlang developers, so I was wondering what people expect
> these days when using recent versions of Erlang > 20.
>
> * passing options to a function: would you still expect to use a
> `propslist` or a `map`? In which case are you using one or the other?
>

I usually prefer the readability of a maps match in a function head or
guard for options over the more complex use of proplists. However, for
compatibility reason I tend to support proplist for options as well.
Converting proplists to maps is straight forward, so the coast of
supporting both should be quite low.

Andreas

>
> --
-- 
Dipl.-Inform. Andreas Schultz

----------------------- enabling your networks ----------------------
Travelping GmbH                     Phone:  +49-391-81 90 99 0
Roentgenstr. 13                     Fax:    +49-391-81 90 99 299
39108 Magdeburg                     Email:  info@REDACTED
GERMANY                             Web:    http://www.travelping.com

Company Registration: Amtsgericht Stendal        Reg No.:   HRB 10578
Geschaeftsfuehrer: Holger Winkelmann          VAT ID No.: DE236673780
---------------------------------------------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20181026/f3d19eb7/attachment.htm>


More information about the erlang-questions mailing list