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

The 'undefined' atom #4

Closed
aberman opened this issue Jun 30, 2011 · 3 comments
Closed

The 'undefined' atom #4

aberman opened this issue Jun 30, 2011 · 3 comments

Comments

@aberman
Copy link

aberman commented Jun 30, 2011

Is there any way you can add the undefined atom as having the same functionality as null. Erlang uses undefined within the standard lib and I think it makes things more consistent. I also do think that null in Json should translate back to the undefined atom. Or maybe you could change it to configure what the user wants null in Json to translate to in Erlang?

@davisp
Copy link
Owner

davisp commented Jun 30, 2011

By default, no. Very specifically because JavaScript has a notion of undefined that is kinda sorta represented in JSON (the lack of a key in an object).

As to making it configurable that's not out of the question I don't think.

@aberman
Copy link
Author

aberman commented Jun 30, 2011

I agree that in JSON it has to be represented as null. I'm suggesting that when the parser sees undefined it represents it as null in JSON. The other part I realize is a bit more difficult and that's where I think the configuration setting would make sense.

@davisp
Copy link
Owner

davisp commented Aug 3, 2011

Just re-read this ticket again. At this point I'm going to ixnay the use of translating undefined to null and back. I understand that its used in the Erlang stdlib as a sort of representative for null, but I think the translation will end up being confusing given JSON semantics. Also, having a light wrapper to do this in app code would be about 5-7 lines so I'm not very motivated to add specific support for it.

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

2 participants