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

Closed
wants to merge 1 commit into
base: 4.05
from

Conversation

Projects
None yet
2 participants
@gasche
Member

gasche commented Mar 5, 2017

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

@gasche gasche referenced this pull request Mar 5, 2017

Closed

Quoted strings #1066

@Octachron

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:

Show outdated Hide outdated manual/manual/refman/exten.etex
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.

This comment has been minimized.

@Octachron

Octachron Mar 5, 2017

Contributor

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

@Octachron

Octachron Mar 5, 2017

Contributor

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

This comment has been minimized.

@gasche

gasche Mar 5, 2017

Member

I replaced here "foo" with here "|foo}".

@gasche

gasche Mar 5, 2017

Member

I replaced here "foo" with here "|foo}".

Show outdated Hide outdated manual/manual/refman/exten.etex
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.

This comment has been minimized.

@Octachron

Octachron Mar 5, 2017

Contributor

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.

@Octachron

Octachron Mar 5, 2017

Contributor

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

This comment has been minimized.

Show comment
Hide comment
@gasche

gasche Mar 5, 2017

Member

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

Member

gasche commented Mar 5, 2017

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

Quoted string and extension nodes: manual clarification
This manual clarification is intended to lift up the misunderstanding
that is the basis for #1066.
@gasche

This comment has been minimized.

Show comment
Hide comment
@gasche

gasche Mar 5, 2017

Member

Merged in 4.05 and trunk.

Member

gasche commented Mar 5, 2017

Merged in 4.05 and trunk.

@gasche gasche closed this Mar 5, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment