Xen / examples v0.1.0-demo.2
Code examples
This topic is not available in the selected language or version. Showing the start of this section.
Complete source, commands, and expected output from the release materials. Of 19 Xen files, two are support modules for the multi-file example. Start with installation.
Fundamentals
Section titled “Fundamentals”- First program —
hello.xen - Names, changes, numbers —
variables.xen - Functions and loops —
control_flow.xen - Split and print words —
demo.xen - A greeting —
arm64_core.xen
Data and ownership
Section titled “Data and ownership”- Strings, vectors, views —
collections.xen - Transforming items —
iterators.xen - Structs, enums, tuples —
types.xen - Reuse with different types —
generics.xen - Copies, references, moves —
ownership.xen - Connected values —
recursive_data.xen - Lookup by key —
hashmap.xen
Input and errors
Section titled “Input and errors”- Handling failed input —
errors.xen - Read a file —
word_count.xen - Read a pipeline —
stdin_words.xen
Multiple files
Section titled “Multiple files”- Split a program across files —
modules/app.xen
Testing
Section titled “Testing”- Test a function —
testing.xen