Skip to content

Conversation

lihaoyi
Copy link
Contributor

@lihaoyi lihaoyi commented Aug 15, 2025

No description provided.

> lines. However, if you write whitespace at the beginning of a line in addition to what’s before
> the closing quotation marks, that whitespace is included.

### Elixer

Choose a reason for hiding this comment

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

*Elixir


## Literal/Singleton Types

`.stripLiteral` strings are not literals, and cannot generate `String & Singleton` types

Choose a reason for hiding this comment

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

typo .stripMargin. Not sure if transparent inline is addressed for current art of Singleton via custom solution.

@SimY4
Copy link

SimY4 commented Aug 15, 2025

Just a thought, instead of having a new syntax construct, we can probably have yet another standard string interpolator. Can be macro to deal with the problem at compile time.

@lihaoyi
Copy link
Contributor Author

lihaoyi commented Aug 16, 2025

@SimY4 the proposal discusses why a string inteprolator wouldn't work as well. Specifically, it won't compose with other interpolators like sql"...", it won't work in literal types like val x: "..." = ???, it won't work in literal-only contexts like fastparse.StringIn() or @implicitNotFound("...")

@kyouko-taiga kyouko-taiga changed the title SIP-XX Dedented Multiline String Literals SIP-72 Dedented Multiline String Literals Aug 22, 2025
@SimY4
Copy link

SimY4 commented Aug 22, 2025

@lihaoyi on this tho, in terms of what's easier to evolve - a language or a library DSL, I think library is much more flexible in this regard. Libraries can chose to provide DSLs that will deal with margins differently. I did that for my own custom DSLs and it worked pretty great. Users don't have to add strip margin at the end of every string block - it just worked.

Over time you can deprecate and phase out the old DSL from the library. You can't phase it out of the language.

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

Successfully merging this pull request may close these issues.

8 participants