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

Quoted string and extension nodes: manual clarification #1082

Conversation

gasche
Copy link
Member

@gasche gasche commented Mar 5, 2017

This manual clarification is intended to lift up the misunderstanding
that is the basis for #1066.

@gasche gasche mentioned this pull request Mar 5, 2017
Copy link
Member

@Octachron Octachron left a 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:

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.
Copy link
Member

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 {| {| |}"{|"

Copy link
Member Author

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}".

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.
Copy link
Member

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.

@gasche gasche force-pushed the quoted-string-extension-node-manual-clarification branch from b31ddf0 to 9b83b93 Compare March 5, 2017 17:21
@gasche
Copy link
Member Author

gasche commented Mar 5, 2017

Thanks @Octachron, I amended the PR according to your advice.

@gasche gasche force-pushed the quoted-string-extension-node-manual-clarification branch from 9b83b93 to dd6f4a8 Compare March 5, 2017 17:24
This manual clarification is intended to lift up the misunderstanding
that is the basis for ocaml#1066.
@gasche
Copy link
Member Author

gasche commented Mar 5, 2017

Merged in 4.05 and trunk.

@gasche gasche closed this Mar 5, 2017
EmileTrotignon pushed a commit to EmileTrotignon/ocaml that referenced this pull request Jan 12, 2024
* 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)
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