Skip to content

Multi-line string literal proposals. #322

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

Closed
wants to merge 2 commits into from

Conversation

johnno1962
Copy link
Contributor

@johnno1962 johnno1962 commented May 15, 2016

Swift evolution propoasl for adding multi-line string literals to the Swift languge. It lists three syntaxes hopefully all of which could be made available to different constituencies in the Swift community.

The proposal was explored in an existing PR and “prototype toolchain”:
swiftlang/swift#2275
http://johnholdsworth.com/swift-LOCAL-2016-05-09-a-osx.tar.gz


This proposal puts forward three alternate syntaxes for discussion: `"continuation quotes"`, `"""long strings"""`
and `<<"heredoc"`. It has been shown all three can co-exist in the same parser and it is proposed all
three should be made available to the Swift developer to chose according to their preference though
Copy link
Contributor

Choose a reason for hiding this comment

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

"to choose"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ta JP

@Coeur
Copy link
Contributor

Coeur commented Dec 29, 2016

The proposal should focus on the triple quotes syntax and leave the others as considered alternatives because:

  • once a solution is implemented, additional solutions would clutter the language and be rejected
  • the continuation quotes are a visual clutter and copy-past clutter
  • the Heredoc strings are breaking visual source file order

Also, the proposal could consider an arbitrary number of quotes to encapsulate multiquotes in the string itself, just like the markdown syntax with multiple backticks where ```` can encapsulate ```

@DougGregor
Copy link
Member

I'm closing out PRs for proposals that are out of scope for Swift 4 stage 1. When we open up the process to the point where this proposal can be in scope, please re-open the pull request.

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.

5 participants