class Meta::ClassDef[T] < Type[T]
The class being declared, as a static statement and the static
class method it calls see it through self: a Type[T] (the class
as a value, with its class methods and the reflection) that will
also take the members a static def generates. At run time, in a
static def that is not compile-time only, self is the class
value itself.
<prelude>:164
Methods
def def_method[R](name: Symbol, visibility: Symbol = …, &body: T.() -> R) -> Void
Generation (docs/14 §5): a method name of the class, whose body
is the block (its self an instance; the values it captures are
baked into the method). The block's parameters take the names
given, in order; the block cannot assign what it captures, leave
the enclosing method or use its self.
<prelude>:170
def def_method[A, R](name: Symbol, param: Symbol, visibility: Symbol = …, &body: T.(A) -> R) -> Void
<prelude>:171
def def_method[A, B, R](name: Symbol, params: [Symbol, Symbol], visibility: Symbol = …, &body: T.(A, B) -> R) -> Void
<prelude>:172
def def_class_method[R](name: Symbol, visibility: Symbol = …, &body: Type[T].() -> R) -> Void
The same for a class method: the block's self is the class.
<prelude>:174
def def_field[U](name: Symbol, type: Type[U], default: U, var: Bool = …, reader: Bool = …, writer: Bool = …) -> Void
A field @name of the class, of a class type without type
parameters, with default (a value made at compile time, baked
into the class), assignable when var: is true, with the accessors
reader: and writer: ask for (as attr_reader/attr_writer).
<prelude>:179
def doc(text: String) -> Void
The documentation comment of the next method generated.
<prelude>:181