You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This feature request has resurfaced frequently, but I cannot readily find any related proposals/issues. So, I am requesting again to add specific syntax for multiline character literal constants in the language, much similar to the functionality of Python docstrings.
Currently, writing a multiline text is a cumbersome process. For example,
could be written much more cleanly with a new syntax like,
str = `
This
is
a
multiline
string.`
where the backtick serves as a multiline delimiter that includes the new line characters in the literal constant.
This new syntax (or similar) would also allow hassle-free repeated usage of single and double quotation marks ' and " in a string.
My primary use case for this facility is the seamless incorporation and migration of hard-coded text and paragraphs in various source codes in multiple different programming languages. Currently, this is practically impossible without some preprocessing of the text.
Given the extensive discussions of this feature among users, I hope this request makes it into future committee meetings for discussion and inclusion.
The text was updated successfully, but these errors were encountered:
I wonder if we could use """ as in Python. It would not be strictly backwards compatible though.
It wouldn't be backwards compatible at all -- it's the start of an unterminated character literal constant.
''" ... "'' and ""' ... '"" would work, and their terminators are unlikely to appear in the text. But I suspect that you need something that would allow anything to appear, no matter how unlikely.
This feature request has resurfaced frequently, but I cannot readily find any related proposals/issues. So, I am requesting again to add specific syntax for multiline
character
literal constants in the language, much similar to the functionality of Python docstrings.Currently, writing a multiline text is a cumbersome process. For example,
could be written much more cleanly with a new syntax like,
str = ` This is a multiline string.`
where the backtick serves as a multiline delimiter that includes the new line characters in the literal constant.
This new syntax (or similar) would also allow hassle-free repeated usage of single and double quotation marks
'
and"
in a string.My primary use case for this facility is the seamless incorporation and migration of hard-coded text and paragraphs in various source codes in multiple different programming languages. Currently, this is practically impossible without some preprocessing of the text.
Given the extensive discussions of this feature among users, I hope this request makes it into future committee meetings for discussion and inclusion.
The text was updated successfully, but these errors were encountered: