@[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 : Lake.Name)
(initDecl : Lake.Name)
:
Run the initializer for decl
and store its value for global access. Should only be used while importing.
Set of modules for which we have already run the module initializer in the interpreter.
unsafe def
Lean.registerInitAttrUnsafe
(attrName : Lake.Name)
(runAfterImport : Bool)
(ref : Lake.Name)
:
@[inline]
def
Lean.registerInitAttr
(attrName : Lake.Name)
(runAfterImport : Bool)
(ref : autoParam Lake.Name _auto✝)
:
Equations
- Lean.registerInitAttr attrName runAfterImport ref = Lean.registerInitAttrInner attrName runAfterImport ref
def
Lean.getInitFnNameForCore?
(env : Lean.Environment)
(attr : Lean.ParametricAttribute Lake.Name)
(fn : Lake.Name)
:
Equations
- Lean.getInitFnNameForCore? env attr fn = match attr.getParam? 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 : Unit) => Lean.getRegularInitFnNameFor? env fn
def
Lean.isIOUnitInitFnCore
(env : Lean.Environment)
(attr : Lean.ParametricAttribute Lake.Name)
(fn : Lake.Name)
:
Equations
- Lean.isIOUnitInitFnCore env attr fn = match attr.getParam? 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 = (Lean.getInitFnNameFor? env fn).isSome
def
Lean.setBuiltinInitAttr
(env : Lean.Environment)
(declName : Lake.Name)
(initFnName : optParam Lake.Name Lean.Name.anonymous)
:
Equations
- Lean.setBuiltinInitAttr env declName initFnName = Lean.builtinInitAttr.setParam env declName initFnName
Equations
- One or more equations did not get rendered due to their size.