MCPcopy Index your code
hub / github.com/clojure/clojure / eval

Method eval

src/jvm/clojure/lang/Compiler.java:2008–2033  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2006 }
2007
2008 public Object eval() {
2009 try
2010 {
2011 Object targetval = target.eval();
2012 Object[] argvals = new Object[args.count()];
2013 for(int i = 0; i < args.count(); i++)
2014 argvals[i] = ((Expr) args.nth(i)).eval();
2015 if(method != null)
2016 {
2017 LinkedList ms = new LinkedList();
2018 ms.add(method);
2019 return Reflector.invokeMatchingMethod(methodName, ms, targetval, argvals);
2020 }
2021 if(qualifyingClass != null)
2022 return Reflector.invokeInstanceMethodOfClass(targetval, qualifyingClass, methodName, argvals);
2023 else
2024 return Reflector.invokeInstanceMethod(targetval, methodName, argvals);
2025 }
2026 catch(Throwable e)
2027 {
2028 if(!(e instanceof CompilerException))
2029 throw new CompilerException(source, line, column, null, CompilerException.PHASE_EXECUTION, e);
2030 else
2031 throw (CompilerException) e;
2032 }
2033 }
2034
2035 public boolean canEmitPrimitive(){
2036 return method != null && Util.isPrimitive(method.getReturnType());

Callers

nothing calls this directly

Calls 7

invokeMatchingMethodMethod · 0.95
invokeInstanceMethodMethod · 0.95
evalMethod · 0.65
countMethod · 0.65
nthMethod · 0.65
addMethod · 0.65

Tested by

no test coverage detected