!7 concept FunctionDef { S functionName; S snippetID; } cmodule LoadedStandardFunctions > DynCRUD { transient Map loadedBlobs = syncMap(); // snippetID -> main class transient S status; start { dbIndexing FunctionDef('functionName); updateStatus(); } visual centerAndSouth(super, withLeftRightAndTopMargin(dm_centeredLabel status())); Class getBlob(S _snippetID, S forFunction) { S snippetID = fsI(_snippetID); Class _blob = loadedBlobs.get(snippetID); if (_blob != null) ret _blob; ret dm_evalInQ(() -> { Class blob = loadedBlobs.get(snippetID); if (blob == null) { print("Hotwiring " + snippetID + " for function " + forFunction); loadedBlobs.put(snippetID, blob = hotwireDependent(snippetID)); updateStatus(); } ret blob; }); } void updateStatus { setField(status := n2(loadedBlobs, "loaded blob")); } // API ObjectPlusMethodName getFunction(S name) { FunctionDef def = conceptWhere FunctionDef(functionName := name); if (def == null) null; O blob = getBlob(def.snippetID, name); if (blob == null) null; ret ObjectPlusMethodName(blob, name); } }