Skip to content

String interpolation #230

@aallan

Description

@aallan

Add string interpolation syntax for constructing strings from expressions.

Motivation

Prompt construction is the dominant string operation in LLM agent code. Currently Vera requires multiple string_concat calls or chained IO.print statements. String interpolation dramatically reduces this friction.

Proposed syntax

To be determined. Options include:

-- Option A: f-string style
let @String = f"Hello, {name}! You have {count} items."

-- Option B: template literal style
let @String = `Hello, ${name}! You have ${count} items.`

Canonical form

The formatter must normalize interpolated strings to a single canonical form to preserve Vera's one-way-to-write-it principle. Only expressions (not statements) should be allowed inside interpolation braces.

Dependencies

  • None (grammar + transform + codegen change)

Metadata

Metadata

Assignees

No one assigned

    Labels

    C8.5C8.5 — CompletenessenhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions