Files
ziran/examples/variables.zi
T
waozi 10e854af6b Add native std facades, fix ASCII lowercase and move site examples
Portable standard facades for byte text, environment, timers, randomness,
mapped files, streams, worker pools, directory trees and threads; full ASCII
lowercase in std/unicode; examples move to examples/ with generated site
pages; Go output handles mixed-width slice bounds.
2026-11-12 19:15:45 -03:00

22 lines
475 B
Ziran

// Variables and constants: a declared type, an inferred type, a default
// zero value, and a compile-time constant.
LIMIT :: 100;
main :: () {
greeting: string = "initial";
print("%\n", greeting);
first: s32 = 1;
second: s32 = 2;
print("% %\n", first, second);
ready := true;
print("%\n", ready);
count: s32;
print("% (a variable starts at zero)\n", count);
fruit := "apple";
print("% and the limit is %\n", fruit, LIMIT);
}