Examples

Views

A str points into someone's bytes and says whose.

main (bytes, print)

# str is a view into someone else's bytes. A function returning a view
# says which parameter it came from with `from`.
afterColon(text str) str from text
    at = bytes.indexOf(text, ":") ?: 0 - 1
    if at < 0
        text
    text[at + 1:len(text)]

main()
    line = [byte: *"key:value"]
    value = afterColon(line[0:len(line)])
    same = bytes.equal(value, "value")
    print.line("{value} {same}")
value true