-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Quoted string and extension nodes: manual clarification #1082
Quoted string and extension nodes: manual clarification #1082
Conversation
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 agree that it is very good idea to rephrase the description of quoted strings to precise how they should be used in conjunction with ppx extensions. Few remarks:
manual/manual/refman/exten.etex
Outdated
Quoted strings "{foo|...|foo}" provide a different lexical syntax to | ||
write string literals in OCaml code. They are useful to represent | ||
strings of arbitrary content without escaping -- as long as the | ||
delimiter you chose (here "foo") does not occur in the string itself. |
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.
as long as the delimiter you chose (here "foo")
I think that the wording is not optimal here: it could be read as a warning against {foo|…foo…|foo}
rather than {foo|…|foo}…|foo}
. Similarly, it might be worthwhile to mention that {id|
delimiters do not nest and {| {| |}
≡"{|"
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 replaced here "foo"
with here "|foo}"
.
manual/manual/refman/exten.etex
Outdated
quotes. Note that the non-extension form, for example "{sql|...|sql}", | ||
should not be used for this purpose, as the user cannot see in the | ||
code that this string literal has a different semantics than they | ||
expect. |
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.
Another point that could eventually be mentioned here is that using the extra delimiters identifier to express semantic will interfere with their intended use case of avoiding escaping issues.
b31ddf0
to
9b83b93
Compare
Thanks @Octachron, I amended the PR according to your advice. |
9b83b93
to
dd6f4a8
Compare
This manual clarification is intended to lift up the misunderstanding that is the basis for ocaml#1066.
Merged in 4.05 and trunk. |
* rearrange blog.eml page layout to have less boilerplate and clearer heading "OCaml Community Blog" to make it more obvious what's being shown here * change featured post to "The Journey to OCaml Multicore: Bringing Big Ideas to Life" * change featured section to not require three featured posts. Anything from 1-3 works fine. * clean up HTML and styles a bit (use h2 and h1, remove unnecessary wrapper div)
This manual clarification is intended to lift up the misunderstanding
that is the basis for #1066.