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

    Split and print words

    Split and print words

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

    Terminal window
    xen check examples/demo.xen
    xen run examples/demo.xen
    Hello
    from
    Xen
    demo.xen
    // SPDX-License-Identifier: MIT OR Apache-2.0
    use std.string;
    fn main() {
    let words = std.string.split_ascii_whitespace("Hello from Xen");
    for index in 0..words.len() {
    println(words.get(index));
    }
    }

    Download file

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

    Run the generated executable on a compatible Linux machine.