Lessons

lesson 04 / 15

Lists

A list is declared with an indented sequence. Each item starts with -.

kongue
packages:
    - "kpkg"
    - "kosh"
    - "jumpstart"

main {
    print "The first package is ${packages[0]}"
}

List indexing and slices are used inside ${...} expressions. A list can also be joined into a string with .join().

kongue
parts:
    - "usr"
    - "local"
    - "bin"

main {
    print "${parts.join("/")}"
}