Xen / examples v0.1.0-demo.2
Names, changes, numbers
This topic is not available in the selected language or version. Showing the start of this section.
Names, changes, numbers
Run from the repository or distribution root. Put xen on PATH, or substitute ./bin/xen.
xen check examples/variables.xenxen run examples/variables.xenExpected output
Section titled “Expected output”3618.0Complete source
Section titled “Complete source”// SPDX-License-Identifier: MIT OR Apache-2.0fn main() { let price: Int = 12; let mut quantity = 2; quantity = quantity + 1; let total = price * quantity; println(total); println(float(total) / 2.0);}Build an executable
Section titled “Build an executable”xen build examples/variables.xen -o appRun the generated executable on a compatible Linux machine.