[erlang-questions] Type spec for application:get_env and set_env

Steve Vinoski vinoski@REDACTED
Thu Jul 24 15:50:37 CEST 2014


On Thu, Jul 24, 2014 at 9:05 AM, Max Treskin <zerthurd@REDACTED> wrote:

> Hello
>
> It is possible to use any term() as a key in application:set_env and then
> retrieve a value by this term using application:get_env (what is very
> conveniently), but only atom() is allowed as a key in type spec of these
> functions.
> My proposal is to change type spec in favour of any term usage as a key.
> Any cons?
>

I previously brought this up with the OTP team and was reminded that this
also affects config files, .app files, and also setting env vars from the
command line, with the point being that there could well be unintended side
effects of such a change. Some Riak code used to take advantage of what
you've described, but after the discussion we modified our code to honor
the type spec.

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


More information about the erlang-questions mailing list