String interpolation #90
springcomp
started this conversation in
Ideas
Replies: 1 comment 2 replies
-
I am not sure I like the idea of using untypable syntax. It would be better to simply support quote prefixes like Where do we draw the line between using syntax for data structure manipulation and functions for data transforms? The arithmetic operators begin to violate that principle, but the argument is that they are such common and useful transforms that it is intuitive to have them as syntax. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
String interpolation is a powerful feature in many modern languages.
It may be worth considering it - in addition of or completely separated from the
format()
function.I can see value in supporting syntax such as:
search( «{greetings}, {dude}!» , { "greetings": "Hello", "dude": "World" } ) -> "Hello, world!"
This would need help from the lexer and parser though so might prove overly complex.
The preceding example uses
interpolated-string
because we probably need yet another quotation mark character. Maybe:Beta Was this translation helpful? Give feedback.
All reactions