@[extern lean_run_mod_init]
Run the initializer of the given module (without builtin_initialize
commands).
Return false
if the initializer is not available as native code.
Initializers do not have corresponding Lean definitions, so they cannot be interpreted in this case.
@[extern lean_run_init]
unsafe opaque
Lean.runInit
(env : Lean.Environment)
(opts : Lean.Options)
(decl : Lean.Name)
(initDecl : Lean.Name)
:
Run the initializer for decl
and store its value for global access. Should only be used while importing.
Equations
- One or more equations did not get rendered due to their size.
@[implementedBy Lean.registerInitAttrUnsafe]
def
Lean.getInitFnNameForCore?
(env : Lean.Environment)
(attr : Lean.ParametricAttribute Lean.Name)
(fn : Lean.Name)
:
Equations
- Lean.getInitFnNameForCore? env attr fn = match Lean.ParametricAttribute.getParam attr env fn with | some Lean.Name.anonymous => none | some n => some n | x => none
@[export lean_get_builtin_init_fn_name_for]
Equations
@[export lean_get_regular_init_fn_name_for]
Equations
@[export lean_get_init_fn_name_for]
Equations
- Lean.getInitFnNameFor? env fn = HOrElse.hOrElse (Lean.getBuiltinInitFnNameFor? env fn) fun x => Lean.getRegularInitFnNameFor? env fn
def
Lean.isIOUnitInitFnCore
(env : Lean.Environment)
(attr : Lean.ParametricAttribute Lean.Name)
(fn : Lean.Name)
:
Equations
- Lean.isIOUnitInitFnCore env attr fn = match Lean.ParametricAttribute.getParam attr env fn with | some Lean.Name.anonymous => true | x => false
@[export lean_is_io_unit_regular_init_fn]
Equations
@[export lean_is_io_unit_builtin_init_fn]
Equations
Equations
- Lean.isIOUnitInitFn env fn = (Lean.isIOUnitBuiltinInitFn env fn || Lean.isIOUnitRegularInitFn env fn)
Equations
- Lean.hasInitAttr env fn = Option.isSome (Lean.getInitFnNameFor? env fn)
def
Lean.setBuiltinInitAttr
(env : Lean.Environment)
(declName : Lean.Name)
(initFnName : optParam Lean.Name Lean.Name.anonymous)
:
Equations
- Lean.setBuiltinInitAttr env declName initFnName = Lean.ParametricAttribute.setParam Lean.builtinInitAttr env declName initFnName
Equations
- One or more equations did not get rendered due to their size.