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

Make [] legal in selector #353

Closed
AndyJado opened this issue Sep 26, 2022 · 4 comments
Closed

Make [] legal in selector #353

AndyJado opened this issue Sep 26, 2022 · 4 comments

Comments

@AndyJado
Copy link

AndyJado commented Sep 26, 2022

I don't see progress in empty/null/undefined in selector

but is there a way I can do the following code less painful?

if-I-have-empty-string-in-selector = 
    {$hello ->
        [] {""}
        *[other] {$hello} there
    }
@alerque
Copy link
Contributor

alerque commented Sep 26, 2022

I don't think opening a new issue to say "no progress on old issue" is very helpful.

No answer the question, the current "correct" way to do this is with two messages and use your program logic to pick the correct message, one for when you have variables to send and a different message for when you have nothing to send.

@AndyJado
Copy link
Author

well my problem is I believe that issue still has no progress for two years somehow is a issue ;)

if you have string based selector, however some specific string is implicitly illegal, may I ask why? a empty string not considered a string?

@alerque
Copy link
Contributor

alerque commented Sep 26, 2022

a empty string not considered a string?

Because in most programming languages an array key cannot be empty. There may be a use for it in this case, but that's exactly what the other issue proposes and there is lots of discussion about the ups and downs it will entail in various languages. If you have something to add to that discussion weigh in there, there is not point in rehashing it in a new thread and scattering the info. Scattered discussions just makes it harder to act on an issue.

@AndyJado
Copy link
Author

Because in most programming languages an array key cannot be empty.

okay I see the intention now, thank you for sharing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants