OxL Reference

kw return

Reserved keyword

The list of words: §1.4

Syntax

ebnf
Primary     = Literal | Path | "it" | "self" | "(" Expr { "," Expr } ")" | ListLit | MapLit
            | StructLit | Lambda | Block | If | Match | For | While | Loop | Scope | Select | Query
            | "spawn" ( Postfix | Block ) | "await" Unary | "atomic" [ "(" Args ")" ] Block
            | "return" [ Expr ] | "fail" Expr | "yield" Expr | "respond" Expr | "break" [ Label ] [ Expr ]
            | "continue" [ Label ] | "emit" Path "(" Expr ")" | "unsafe" Block | "blocking" Block
            | "comptime" Block | "." Ident [ "(" [ Args ] ")" ] ;

Grammar: App. A

Defined in

  • 5.8 Other expressions — defer e — executes e on leaving the block (including on fail, return, cancellation), in the reverse order of declaration.
  • 6.4 Return — return e terminates the function.
  • 3.1 Primitives — Integer arithmetic.
  • 1.4 Keywords — Reserved (cannot be used as names)

See also