-
Notifications
You must be signed in to change notification settings - Fork 319
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
Comments
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. |
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. |
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. |
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?
The text was updated successfully, but these errors were encountered: