Replies: 6 comments
-
|
I think expected result should be an error because there is no closing Doesn't matter that it's added on the next line. The definition of string interpolation is Would you want it to work like mut str := '$'
str += '{'
str += '5'
str +' '}'? I vote that the full |
Beta Was this translation helpful? Give feedback.
-
|
Another Example: println('Run ${'v help'} for usage.')This produces the output: While this works, it's confusing because:
Suggested Behavior: The compiler should enforce that This would make the language more predictable and prevent confusion about what constitutes valid string |
Beta Was this translation helpful? Give feedback.
-
|
Agreed, except on the quotes. Anything inside the Otherwise, println('He said "You'll be sorry!"')would be invalid, while it works now (as it should). |
Beta Was this translation helpful? Give feedback.
-
The language is already predictable for the parser - it expects I do not see a good way to make it more predictable, without also crippling it for valid use cases, like generated code for instance. |
Beta Was this translation helpful? Give feedback.
-
|
What do you think of just changing vfmt, to produce: |
Beta Was this translation helpful? Give feedback.
-
|
See also #24198 which has this example: import term
fn main() {
println('Hey it\'s ${term.blue('Tony\'s')} car !')
} |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Describe the bug
see code
may related to #26382
Reproduction Steps
i.v
Expected Behavior
not sure , what is the expected result?
Current Behavior
Possible Solution
No response
Additional Information/Context
No response
V version
V 0.5.0 394abc1.09aa031
Environment details (OS name and version, etc.)
Note
You can use the 👍 reaction to increase the issue's priority for developers.
Please note that only the 👍 reaction to the issue itself counts as a vote.
Other reactions and those to comments will not be taken into account.
Beta Was this translation helpful? Give feedback.
All reactions