Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

json <-> erlang mapping (null is undefined) #18

Closed
kostiushkin opened this issue Jun 11, 2012 · 7 comments
Closed

json <-> erlang mapping (null is undefined) #18

kostiushkin opened this issue Jun 11, 2012 · 7 comments

Comments

@kostiushkin
Copy link

Displaying json null as an atom null in erlang incorrectly, in Erlang null is atom undefined

@talentdeficit
Copy link
Owner

i think there's a (subtle) difference between null and undefined and am not in favour of equating them, but i'm open to having my mind changed

my main concern is that proplists use undefined to represent keys that are not present, while keys that have value null ARE present

@kostiushkin
Copy link
Author

In fact, undefined is used not only in proplists, but also in the records, and in many other modules.

In erlang records undefined used in same context as null in json.

@talentdeficit
Copy link
Owner

right, but proplists are relevant because they are the default representation of jaon objects when decoded. if json null is mapped to erlang undefined, the proplists module can no longer distinguish between "{"key": null}" and "{}". while this is probably harmless, it does concern me

@kostiushkin
Copy link
Author

I'm sure, this is not only harmless but even useful.

@viplifes
Copy link

null is not undefined. So do not.

@kostiushkin
Copy link
Author

I am glad to agree, but where are the arguments?

My arguments were higher, and they are based on the fact that in erlang no null but there are undefined.

@kostiushkin
Copy link
Author

As I discovered, some erlang applications really use atom null, although I still believe it is wrong, the issue no longer seems so simple.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants