kw self
Reserved keyword
The list of words: §1.4
Syntax
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
- 4.5 impl and methods — Inside a method self and Self are available.
- 4.7 Embedding and overriding — There is no implementation inheritance.
- 2.2 Import — The first segment of the path MUST be std, self, super or the name of a dependency from oxl.toml.
- 3.6 Aliases, new types and refined types — distinct T creates a new nominal type with the representation of T.
- 6.5 Errors — There are no exceptions.
- 7.2 Borrows — &x creates a shared borrow, &var x an exclusive one.
- 4.6 Interfaces — Interfaces are structural
- 1.4 Keywords — Reserved (cannot be used as names)
Examples
use std.time { Duration, now }
use std.http.{Client as Http}
use self.billing { charge } // a module of one's own package
use super.common { Money } // the parent module
use auth.tokens { verify } // a dependency from oxl.toml
use parsers { <|> } // importing an operator
use std.coll.* // all pub names (a warning in libraries)Related diagnostics
impl-foreign-type, unknown-method, ambiguous-embed, missing-override, override-without-open, bad-import-root, glob-import, import-conflict, unresolved-import, unresolved-name, refinement-violated, fail-type, question-context, unhandled-error