Skip to main content

Expressions

In duck, almost anything is an expression

src/structs.duck
use std::io::println;

fn main() {
const a = {
// use blocks as expressions
println("do some stuff");
3
};

// use if as expression
const b = if (true) { 1 } else { 2 };
}