Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

String interpolation #49

Open
kevlarr opened this issue Jun 10, 2022 · 0 comments
Open

String interpolation #49

kevlarr opened this issue Jun 10, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@kevlarr
Copy link
Collaborator

kevlarr commented Jun 10, 2022

How could a reference be interpolated in a string?

table person (
    kevin (name 'Kevin')

    (name 'Also ${@kevin.name} too')

Patterns like ${..} or #{..} are common in other languages, but maybe something simpler would suffice, such as automatic concatenation:

table person (
    kevin (name 'Kevin')

    -- Without spaces okay
    (name 'Also '@kevin.name' too')

    -- compared to...
    (name 'Also #{@kevin.name} too')
    
    -- with spaces, too
    (name 'Also ' @kevin.name ' too')

    -- compared to...
    (name 'Also #{ @kevin.name } too')

Feels like the fewer special characters the better, from the perspective of a parser or a reader/typer.

Note: Since a reference could be for a column populated by database, there is no guarantee that the referenced value exists at parse time.

@kevlarr kevlarr added the enhancement New feature or request label Jun 10, 2022
@kevlarr kevlarr added this to the Expand literal values milestone Jun 10, 2022
@kevlarr kevlarr mentioned this issue Jun 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant