static HashMap, Class> loadFunctions_cache = new HashMap; static Lock loadFunctions_cached_lock = lock(); sbool loadFunctions_preferDiskCache; // Note: This may use outdated versions of standard functions static Class loadFunctions_cached(S... functions) { ret loadFunctions_cached(asList(functions)); } static Class loadFunctions_cached(Collection functions) { TreeSet functionSet = new TreeSet(functions); lock loadFunctions_cached_lock; Class c = loadFunctions_cache.get(functionSet); if (c != null) ret c; S cached = getTranspiledStandardFunctionsIfCached(functionSet); S transpilation = null; if (cached != null && (loadFunctions_preferDiskCache || standardFunctionsCacheUpToDate(functionSet)) transpilation = cached; if (transpilation != null) { // TODO: LIBS print("Loading " + joinWithPlus(functionSet)); c = veryQuickJava_finish(transpilation, emptyList()); } if (c == null) c = loadFunctions(functionSet); loadFunctions_cache.put(functionSet, c); assertNotNull(loadFunctions_cache.get(functionSet)); ret c; }