構文
構文
RustにGCとパイプライン演算子をくっつけた感じの言語
以下Hello world
code:rust
import gleam/io
pub fn main() {
io.println("Hello world!")
}
Fizzbuzz
code:rust
import gleam/io
import gleam/int
import gleam/string
import gleam/iterator
pub fn main() {
iterator.range(0, 30)
|> iterator.map(fn (n){
case n % 15 {
0 -> "FizzBuzz"
3 | 6 | 9 | 12 -> "Fizz"
5 | 10 -> "Buzz"
n -> int.to_string(n)
}
})
|> iterator.to_list
|> string.join("\n")
|> io.println
}