← All examples

Print weird

std::print.weird — C++'s cout <<, Zag style: each value follows a <-, the arrow pointing into the output, as <- points into a variable in inline.ASM.

print_weird.zg
# `std::print.weird` — C++'s `cout <<`, Zag style (owner, 2026-10-01): each value follows a `<-`,
# the arrow pointing into the output, as `<-` points into a variable in `inline.ASM`. Plain
# `.weird` shows the stored form, as `print` does; `.weird.useful` the useful one, as `print.useful`
# does. The strongest modifier comes first: `.weird` before `.useful`.
MAIN {
    let 'tenth': bin64 = 0.1;
    let 'n' := 3;
    std::print.weird.useful <- "tenth is " <- 'tenth' <- ", n is " <- 'n' <- newln;
    std::print.weird.stored <- "stored: " <- 'tenth' <- newln;
}
Output
tenth is 0.1, n is 3
stored: 0.1000000000000000055511151231257827021181583404541015625