Skip to content

Treat 'undefined' the same way as 'null' #27

Closed
superbobry opened this Issue Jul 19, 2012 · 2 comments

2 participants

@superbobry

What do you think? afaik the usage of null atom in Erlang code is much less common.

@davisp
Owner
davisp commented Jul 19, 2012

It is less common, but that's on purpose. For instance, if I were to decode null into the more "standard" undefined then there are issues when trying to detect if a key doesn't exist vs a key that exists with a value of null.

OTOH, encoding undefined as null isn't too crazy but its kinda weird if you know JavaScript behavior. Granted that shouldn't be a huge thing but I could see it being a surprise.

@davisp
Owner
davisp commented Oct 29, 2012

After thinking on this more I've decided that I'm not going to change this behavior. While I do see the argument for mapping the two conventions, null serves as a useful "no value" marker while undefined remains for Erlang to say "key doesn't exist".

@davisp davisp closed this Oct 29, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.