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

feature request: if #1539

Open
bo-ku-ra opened this issue Aug 7, 2023 · 3 comments
Open

feature request: if #1539

bo-ku-ra opened this issue Aug 7, 2023 · 3 comments

Comments

@bo-ku-ra
Copy link
Contributor

bo-ku-ra commented Aug 7, 2023

vars: {
distribution: 1; #true
}

a:"you"{

e-mail:[email protected]
_phone-no:"mobile: 1111-1111"
}

b:"me"{
e-mail:[email protected]
_phone-no:"mobile: 2222-2222"
}

if ( ${distribution} == 1) {
 *._** : null
} else {
 *._** : { style.font-color: red;}
}
@cyborg-ts cyborg-ts added this to D2 Aug 7, 2023
@soma-m
Copy link

soma-m commented Aug 8, 2023

I've missed the if statement as well.

To simplify the syntax we could also remove the brackets after if

E.g.

if ${variable} == 0

instead of

if ( ${variable} == 0 )

@alixander
Copy link
Collaborator

declarative languages don't have branching, and I don't think D2 should.

i don't think the example is motivating enough.

@bo-ku-ra
Copy link
Contributor Author

bo-ku-ra commented Aug 8, 2023

i can see the policy.

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

No branches or pull requests

3 participants