Skip to content

Comments

fix float encoding#18

Merged
hypirion merged 2 commits intogo-edn:v1from
robx:float
Feb 24, 2018
Merged

fix float encoding#18
hypirion merged 2 commits intogo-edn:v1from
robx:float

Conversation

@robx
Copy link
Contributor

@robx robx commented Feb 13, 2018

1.0 used to be encoded to 1, which is an integer.

It's a bit unclear whether `1.` is a legal float, and the previous
change was making Marshal create EDN which couldn't be parsed back.

Some tests to catch that potential problem.
@robx
Copy link
Contributor Author

robx commented Feb 22, 2018

Just realized the old fix led to floating point numbers that go-edn wasn't happy to parse back. I see in the source that this is intentionally true to the spec and not clojure. Filed a PR against the spec anyway: edn-format/edn#76

@hypirion
Copy link
Member

Thanks, looks good :)

@hypirion hypirion merged commit 67fa305 into go-edn:v1 Feb 24, 2018
@robx robx deleted the float branch February 24, 2018 14:39
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

Successfully merging this pull request may close these issues.

2 participants