Asserted member, index, and call access on known-present values.
Syntax: <expression>!.<name> | <expression>![<expression>] | <expression>!(<args>)
Category
non-null-chain
Related
Examples
examples/corpus/operatores/nonnull-chain.fab (canonical · operator-group)
Asserted member, index, and call access on known-present values.
# operatores/nonnull-chain — !. ![ !(
#
# GRAMMAR:
# nonNullSuffix :← '!.' IDENTIFIER | '![' expr ']' | '!(' argumentList ')'
#
# EXPECTED OUTPUT:
# Marcus, Roma, a
#
# BACKEND:
# Rust: non-null chain lowering gap (whitelist: operatores/nonnull-chain.fab).
genus Persona {
textus nomen
textus urbs sponte
}
incipit {
fixum Persona ∪ nihil p ← Persona { nomen = "Marcus", urbs = "Roma" }
nota p!.nomen
nota p!.urbs
fixum _ litterae ← ["a", "b", "c"]
nota litterae![0]
}Expected output:
Marcus
Roma
a