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

Much ado about nothing, aka nil #7

Open
alerque opened this issue Sep 22, 2019 · 0 comments
Open

Much ado about nothing, aka nil #7

alerque opened this issue Sep 22, 2019 · 0 comments
Labels
help wanted Extra attention is needed question Further information is requested

Comments

@alerque
Copy link
Owner

alerque commented Sep 22, 2019

All the reference fixtures in JSON format show some properties as having null values. Lua of course handles nil a bit differently than some languages. For the purposes of comparing fixtures when I load the JSON into a Lua table everything works out fine because the nulls load as nils and the comparison works okay. However trying to get JSON output that matches is a bit more difficult. For external comparison I'm currently stripping the null's usig jq:

walk( if type == "object" then with_entries(select(.value != null)) else . end)

...but that's a hack.

Should we be using a custom null value in our AST internally so we can match what other implementations have? Or is Lua's nil handling going to suffice?

@alerque alerque changed the title Much ado about nothing Much ado about nothing, aka nil Sep 23, 2019
@alerque alerque added help wanted Extra attention is needed question Further information is requested labels Sep 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant