-
Notifications
You must be signed in to change notification settings - Fork 20
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
Add tests for E-expressions using simple system macros. #100
Conversation
(toplevel ('#$:make_string' "a" b )) | ||
(toplevel ('#$:make_string' a "b")) | ||
(produces "ab")) | ||
// null.string and null.symbol act like "" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting; does $0
also behave this way? I think I expected null
arguments to be an error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great question, I tend to forget about $0
. Heck, we also have absent symbols to deal with.
I cut amazon-ion/ion-docs#324 to deal with that later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I spec'd nulls to act like ""
because their presence doesn't seem problematic enough to treat exceptionally. This way all (known) symbol and string values are accepted without error.
(The cases you call out are arguably encoding defects, so I think they deserve more global handling.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding a bit more detail on my thought process: the typed signature of this macro would be (text::v*)
and I think its preferable for it to succeed given any text
value. So that would include null.string
and null.symbol
for sure, and $0
is technically a valid non-null symbol. All of the above have no text, so I conclude that its reasonable to accept and ignore them (which happens to be indistinguishable from treating them as ""
).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving, but please check that @zslayton's concerns have been addressed before merging.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have reservations about accepting null
s in places that require a sequence or text, but we can go ahead and merge this.
@zslayton I cut amazon-ion/ion-docs#327 -- and there's also amazon-ion/ion-docs#324 -- if those don't cover your concerns well, please comment there. |
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.