Skip to content
Xen / docs

Search documentation

English · v0.1.0-demo.2

Type to search the documentation.

    한국어
    Xen / examples v0.1.0-demo.2

    Names, changes, numbers

    Names, changes, numbers

    Run from the repository or distribution root. Put xen on PATH, or substitute ./bin/xen.

    Terminal window
    xen check examples/variables.xen
    xen run examples/variables.xen
    36
    18.0
    variables.xen
    // SPDX-License-Identifier: MIT OR Apache-2.0
    fn main() {
    let price: Int = 12;
    let mut quantity = 2;
    quantity = quantity + 1;
    let total = price * quantity;
    println(total);
    println(float(total) / 2.0);
    }

    Download file

    Terminal window
    xen build examples/variables.xen -o app

    Run the generated executable on a compatible Linux machine.