soma.cell

Quotes inside {...} interpolation

Pitfall 1 of writing Soma, the programming language: a habit from another language, or a rule that surprises, with what the Soma compiler answers and the form to write.

// WRONG — an unescaped `"` ends the string: `{len(` is left dangling
return "len: {len("hi")}"
// RIGHT — escape it (`"len: {len(\"hi\")}"` prints len: 2), or, clearer,
// bind the value first and interpolate the variable
let n = len("hi")
return "len: {n}"