birds=3
main! = |args|
Stdout.line!("There are ${Num.to_str(birds)} birds.")
Output: There are 3 birds
birds=-3
main! = |args|
Stdout.line!("There are ${Num.to_str(birds)} birds.")
Output: I have no specific suggestion for this operator, see operator-desugaring-table
birds = -3
main! = |args|
Stdout.line!("There are ${Num.to_str(birds)} birds.")
Output: There are -3 birds.
Rust or zig compiler? I assume rust
It's indeed in the rust compiler, birds=-3 works in the zig compiler. Given that this is not a major issue we will not fix this in the old (=rust) compiler @Brian Teague.
Anton has marked this topic as resolved.
Last updated: Dec 21 2025 at 12:15 UTC