← All examples

Join

join.zg
MAIN {
    let 'n' := 3;
    let 's' := "n=" ++ to.stored.str.utf8['n' plus 4];  # arithmetic, convert, then join
    std::print.stored['s', newln];
    std::print.stored["count: " ++ to.stored.str.utf8[10], newln];   # a number is converted, in its stored form
    let 'x': bin64 = 0.1;
    let 't' := "x is " ++ to.stored.str.utf8['x'];   # stored form, always
    std::print.useful['t', newln];             # print.useful cannot undo a join…
    std::print.useful["x is ", 'x', newln];    # …but renders its own values usefully
    if "a" ++ "b" equal_to "ab" { std::print.stored["joined", newln]; }
    let 'c' := `é` ++ "!";
    std::print.stored['c', newln];
}
Output
n=7
count: 10
x is 0.1000000000000000055511151231257827021181583404541015625
x is 0.1
joined
é!