Data update
This commit is contained in:
parent
4bb20c9b71
commit
cbaf4c4b64
12390 changed files with 318560 additions and 27248 deletions
|
|
@ -0,0 +1,18 @@
|
|||
import gleam/int
|
||||
import gleam/io
|
||||
|
||||
pub fn conditional_example(x: Int) {
|
||||
// if's below are called "pattern guards".
|
||||
case x {
|
||||
x if x < 0 -> io.println(x |> int.to_string <> " is negative")
|
||||
x if x == 0 -> io.println(x |> int.to_string <> " is zero")
|
||||
_ -> io.println(x |> int.to_string <> " is positive")
|
||||
}
|
||||
}
|
||||
|
||||
pub fn main() {
|
||||
// Pattern matching is the only conditional structure in Gleam.
|
||||
conditional_example(-10)
|
||||
conditional_example(0)
|
||||
conditional_example(10)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue