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

Remove obsolete note on escapes in interpolations #15450

Closed
wants to merge 1 commit into from

Conversation

som-snytt
Copy link
Contributor

@som-snytt som-snytt commented Jun 15, 2022

Scala 2/3 have parity on "how to escape double quote in an interpolated string with single-double quotes" since #11751

This commit fixes the Edison quotation (though I did not track down a source) and also adds a second bon mot which everyone knows from childhood, to illustrate both forms of escape. Google cites a source which cites the letter.

No links were harmed in the production of this PR.

@som-snytt
Copy link
Contributor Author

The CI failure doesn't tell you where the link is referenced, but looking up the stack:

 java.nio.file.NoSuchFileException: /tmp/sbt_7e88341f/docs/_docs/reference/changed-features/interpolation-escapes.md
	at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:92)
[snip]
	at dotty.tools.scaladoc.site.StaticSiteLoader.loadBasedOnYaml(StaticSiteLoader.scala:92)

So grepping in *.yml finds the two locations. Not sure why there are two. One gets accustomed to automation.

@som-snytt
Copy link
Contributor Author

@pikinier20 is this a no-brainer? I haven't followed whether there are changes in how docs are handled in scala 3.

@som-snytt som-snytt closed this Oct 9, 2022
@SethTisue
Copy link
Member

SethTisue commented Oct 31, 2022

@Sporarum is this one you might be interesting in reopening and reviewing?

@Sporarum
Copy link
Contributor

@som-snytt I'm not very familiar with these escaping questions, could you clarify what you mean by

s"$"hi$"" is interpolator-agnostic. s"\"hi\"" supplies the escapes to the interpolator by not taking \" as end-of-string. The standard interpolator understands \" as literal quote.

@som-snytt
Copy link
Contributor Author

scala 2.13.10> s"$""
val res0: String = "

scala 2.13.10> s"\""
val res1: String = "

scala 2.13.10> raw"\""
val res2: String = \"

@Sporarum
Copy link
Contributor

And from my tests, the behaviour is the same in Scala 3.2.0
So the point of this PR is to say there is no more a difference between 2 and 3, got it

Now the question, why was this PR closed ?

@som-snytt
Copy link
Contributor Author

"Closed for inactivity."

@Sporarum
Copy link
Contributor

Sporarum commented Dec 2, 2022

Oh I see, I believe this would be valuable
I think it is not mergeable as-is, because we wish to keep the links valid

I see two options:

@Sporarum Sporarum reopened this Dec 2, 2022
@som-snytt
Copy link
Contributor Author

@Sporarum I updated the page per your second suggestion, but I made it interesting instead of boring. It's worth advertising the behavior anyway.

Also TIL "Quentin Bernet". Is a bernet the sort of beret they wear in Berne?

@som-snytt
Copy link
Contributor Author

I don't know if that is 99% by weight or volume.

Copy link
Contributor

@Sporarum Sporarum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me !

(I'm not 100% sure of the etymology of my name, but it seems indeed linked with the city of Bern, it might mean "from Bern" or something like that)

Copy link
Contributor

@Sporarum Sporarum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh actually, we should maybe keep a part that explicitly mentions the old Scala 3 behaviour, again for the link's sake ?

Copy link
Contributor

@Sporarum Sporarum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Upon further consideration, I think the raw example should be included before this gets merged, to motivate the existence of the feature, and it's difference with the other way

@som-snytt
Copy link
Contributor Author

Closing again because you're merging #16772 instead. Show some respect.

@som-snytt som-snytt closed this Feb 2, 2023
@som-snytt som-snytt deleted the tweak/doc-interpolation branch February 2, 2023 19:13
@SethTisue
Copy link
Member

@som-snytt can't tell if you're in earnest or not?

I see some overlap between the two PRs, but not all that much.

@som-snytt
Copy link
Contributor Author

My point is that rebasing stale PRs is rock bottom contributor experience. "Use it or lose it."

@som-snytt
Copy link
Contributor Author

som-snytt commented May 24, 2023

This would have been an appropriate section, perhaps, to document scala/bug#12789 rooted StringContext.

Edit: the have a spec version now, so the edit is at https://github.com/lampepfl/dotty/blob/main/docs/_spec/01-lexical-syntax.md

@Sporarum
Copy link
Contributor

As the spec is not ready to deploy yet, the focus should be on fixing the reference

As such, I highly encourage you to reopen this PR which I believe to be valuable
(It is possible you can't reopen it, if that is the case, I'm not sure how to help you as I can't either)

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.

None yet

4 participants