public Object doReset(Object val) { bindRoot(val); return val; }
public Object doReset(Object val) { bindRoot(val); return val; }
public static List<String> processCommandLine(String[] args){ List<String> arglist = Arrays.asList(args); int split = arglist.indexOf("--"); if(split >= 0) { CMD_LINE_ARGS.bindRoot(RT.seq(arglist.subList(split + 1, args.length))); return arglist.subList(0, split); } return arglist; }
public static List<String> processCommandLine(String[] args){ List<String> arglist = Arrays.asList(args); int split = arglist.indexOf("--"); if(split >= 0) { CMD_LINE_ARGS.bindRoot(RT.seq(arglist.subList(split + 1, args.length))); return arglist.subList(0, split); } return arglist; }
public static Var intern(Namespace ns, Symbol sym, Object root, boolean replaceRoot){ Var dvout = ns.intern(sym); if(!dvout.hasRoot() || replaceRoot) dvout.bindRoot(root); return dvout; }
public void init() { ClassLoader origLoader = preInvoke(); try { Field dvalField = Var.class.getDeclaredField("dvals"); dvalField.setAccessible(true); this.dvals = (ThreadLocal)dvalField.get(null); this.require = RT.var("clojure.core", "require"); this.resolve = RT.var("clojure.core", "resolve"); clojure.lang.Compiler.LOADER.bindRoot(this.classLoader); } catch (Exception e) { throw new RuntimeException("Failed to initialize ClojureRuntimeShimImpl", e); } finally { postInvoke(origLoader); } }
public void init() { ClassLoader origLoader = preInvoke(); try { Field dvalField = Var.class.getDeclaredField("dvals"); dvalField.setAccessible(true); this.dvals = (ThreadLocal)dvalField.get(null); this.require = RT.var("clojure.core", "require"); this.resolve = RT.var("clojure.core", "resolve"); clojure.lang.Compiler.LOADER.bindRoot(this.classLoader); } catch (Exception e) { throw new RuntimeException("Failed to initialize ClojureRuntimeShimImpl", e); } finally { postInvoke(origLoader); } }
@Override public void initialize() { this.runtime = new LoaderWrapper(WunderBoss.classLoader()); // we have to touch Clojure.class so it will init clojure enough for // binding the loader's root to work. Without this, we'll NPE Clojure.var("clojure.core", "require"); // we have to bind the loader for cases where the TCCL is the wrong // module inside WildFly (this happens for web requests). If LOADER isn't // bound, clojure.lang.RT will fall back to the TCCL. Compiler.LOADER.bindRoot(WunderBoss.classLoader()); }
private void createNecessaryThreadBindings() { var("user", "input").bindRoot(ioCache.getInputLookupFn()); var("user", "output").bindRoot(ioCache.getOutputLookupFn()); Var.pushThreadBindings(map( var("clojure.core", "*out*"), writer, ns, ns.deref(), output1, null, output2, null, output3, null, lastError, null )); }
public Object eval() { try { if(initProvided) { // if(init instanceof FnExpr && ((FnExpr) init).closes.count()==0) // var.bindRoot(new FnLoaderThunk((FnExpr) init,var)); // else var.bindRoot(init.eval()); } if(meta != null) { IPersistentMap metaMap = (IPersistentMap) meta.eval(); if (initProvided || true)//includesExplicitMetadata((MapExpr) meta)) var.setMeta((IPersistentMap) meta.eval()); } return var.setDynamic(isDynamic); } catch(Throwable e) { if(!(e instanceof CompilerException)) throw new CompilerException(source, line, column, e); else throw (CompilerException) e; } }
public Object eval() { try { if(initProvided) { // if(init instanceof FnExpr && ((FnExpr) init).closes.count()==0) // var.bindRoot(new FnLoaderThunk((FnExpr) init,var)); // else var.bindRoot(init.eval()); } if(meta != null) { IPersistentMap metaMap = (IPersistentMap) meta.eval(); if (initProvided || true)//includesExplicitMetadata((MapExpr) meta)) var.setMeta((IPersistentMap) meta.eval()); } return var.setDynamic(isDynamic); } catch(Throwable e) { if(!(e instanceof CompilerException)) throw new CompilerException(source, line, column, e); else throw (CompilerException) e; } }