Skip to content

String Interpolation #940

Open
Open
@peq

Description

@peq

Add a nicer way to construct strings.

So instead of

return "(" + v.x.toString() + ", " + v.y.toString() + ", " + v.z.toString() + ")"

we could write:

return s"(${v.x}, ${v.y}, ${v.z})"

I am not sure if we should add a special syntax for strings with interpolation (like the s prefix in the example above) or just allow interpolation in every string (and use \$ to write a real dollar sign).

We should also add a syntax for multiline strings, like:

let s = """This is a
           string with
           several lines"""

This thread is open for suggestions and discussion.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions