Xen / examples v0.1.0-demo.2
Split and print words
This topic is not available in the selected language or version. Showing the start of this section.
Split and print words
Run from the repository or distribution root. Put xen on PATH, or substitute ./bin/xen.
xen check examples/demo.xenxen run examples/demo.xenExpected output
Section titled “Expected output”HellofromXenComplete source
Section titled “Complete source”// SPDX-License-Identifier: MIT OR Apache-2.0use std.string;
fn main() { let words = std.string.split_ascii_whitespace("Hello from Xen"); for index in 0..words.len() { println(words.get(index)); }}Build an executable
Section titled “Build an executable”xen build examples/demo.xen -o appRun the generated executable on a compatible Linux machine.