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

Proposals: Allow inserting variable values into strings #518

Open
Sayakie opened this issue Sep 25, 2022 · 2 comments
Open

Proposals: Allow inserting variable values into strings #518

Sayakie opened this issue Sep 25, 2022 · 2 comments
Assignees
Labels
category:feature-request A feature request, i.e: not implemented / a PR. package:core Related to share domain nor script interpreter
Milestone

Comments

@Sayakie
Copy link
Member

Sayakie commented Sep 25, 2022

While I am using various languages every day, it should be awesome if we could be insert any values into strings. Other languages support this proposal with the following syntax like:

Javascript

const someFeature = "An Awesome Feature"
console.log(`Proposal Approved: ${someFeature}`)  // Outputs: Proposal Approved: An Awesome Feature

Rust

let some_feature = "Another Awesome Feature";
println!("Proposal Approved: {some_feature}");  // Outputs: Proposal Approved: Another Awesome Feature

TriggerReactor in this proposal:

someFeature = "Insert values into strings"

#MESSAGE "Proposal Approved: {someFeature}"
@Sayakie Sayakie added package:core Related to share domain nor script interpreter category:feature-request A feature request, i.e: not implemented / a PR. labels Sep 25, 2022
@Sayakie Sayakie self-assigned this Sep 25, 2022
@rkdrns4747
Copy link
Member

I think it would be great if we use ${} logic. We already parsing ${something} inside a string as $something(Placeholder), which is not that welcome-d (at least for me) because it cannot handle parameter and so the function is already fulfilled with "$something " ($+name+space)

So for me, changing ${} 's job from placeholder injector to code injector would be good option for next major (v4.0.0) update.

@Sayakie
Copy link
Member Author

Sayakie commented Sep 26, 2022

Yeah, I think the interpreter(including lexer, and parser also) needs to be refactored, and we should do.

@Sayakie Sayakie added this to the v4 milestone Sep 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:feature-request A feature request, i.e: not implemented / a PR. package:core Related to share domain nor script interpreter
Projects
None yet
Development

No branches or pull requests

2 participants