scope evalJava_prep2. // flag is per thread, cache is per program (in-memory cache of JavaX source -> loaded Class) static new ThreadLocal #useCacheInThread; static volatile bool #useCache; // cached main classes, used only when you enable it static Map #cache = synchronizedMRUCache(100); static O evalJava_prep2(S main) { bool _useCache = useCache || isTrue(useCacheInThread!); if (_useCache) { O obj = cache.get(main); if (obj != null) ret obj; } O obj = veryQuickJava(main); if (_useCache) cache.put(main, obj); makeDependent(obj); setOpt(obj, "getProgramName_cache", "User Code"); ret obj; } end scope