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

How to combine multiple conditional statements #185

Open
jpluscplusm opened this issue Oct 3, 2024 · 0 comments
Open

How to combine multiple conditional statements #185

jpluscplusm opened this issue Oct 3, 2024 · 0 comments
Labels
content idea Idea for a new piece of content howto For content that in the "howto" diataxis quadrant

Comments

@jpluscplusm
Copy link
Collaborator

From https://cuelang.slack.com/archives/CLT3ULF6C/p1725544343237119:

Today people at work were trying to write an if statement as if foo && bar {} instead of if foo if bar {} and I couldn't find an example in the docs that talks specifically about this.

Let's cover:

if foo
if bar if baz {
  something
}

... and also:

if x>1 if y<10 if z==99 {
  something
}

This demonstrates single-line and multi-line multiple-ifs, along with boolean primitives and inline conditions that evaluate to a boolean.

@jpluscplusm jpluscplusm added content idea Idea for a new piece of content howto For content that in the "howto" diataxis quadrant labels Oct 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
content idea Idea for a new piece of content howto For content that in the "howto" diataxis quadrant
Projects
Status: Backlog
Development

No branches or pull requests

1 participant