Zulip Chat Archive
Stream: lean4
Topic: What does "import runtime" do?
Eric Wieser (Aug 04 2024 at 16:28):
I notice that import runtime Lean
is legal syntax, but it doesn't seem to actually do anything in the web editor; is there any documentation on this feature?
Mario Carneiro (Aug 04 2024 at 16:31):
I think it's vestigial
Henrik Böving (Aug 04 2024 at 16:33):
Doing some basic grepping it sets the runtimeOnly
flag in docs#Lean.Import which has precisely one location where it is used:
partial def importModulesCore (imports : Array Import) : ImportStateM Unit := do
for i in imports do
if i.runtimeOnly || (← get).moduleNameSet.contains i.module then
continue
modify fun s => { s with moduleNameSet := s.moduleNameSet.insert i.module }
let mFile ← findOLean i.module
let (mod, region) ← readModuleData mFile
importModulesCore mod.imports
modify fun s => { s with
moduleData := s.moduleData.push mod
regions := s.regions.push region
moduleNames := s.moduleNames.push i.module
}
so for now it noops the import
Eric Wieser (Aug 04 2024 at 17:40):
Are the proposed semantics defined? If not, should runtimeOnly
be removed entirely?
Last updated: May 02 2025 at 03:31 UTC