Upgrade to Clojure 1.5.1 & switch to clojure-slim JAR - #792

This commit is contained in:
Tom Morris 2013-08-26 19:40:37 -04:00
parent 886fb5eee9
commit c68c1bb2b1
4 changed files with 16 additions and 3 deletions

View File

@ -12,7 +12,7 @@
<classpathentry exported="true" kind="lib" path="main/webapp/WEB-INF/lib/ant-tools-1.8.0.jar"/> <classpathentry exported="true" kind="lib" path="main/webapp/WEB-INF/lib/ant-tools-1.8.0.jar"/>
<classpathentry exported="true" kind="lib" path="main/webapp/WEB-INF/lib/arithcode-1.1.jar"/> <classpathentry exported="true" kind="lib" path="main/webapp/WEB-INF/lib/arithcode-1.1.jar"/>
<classpathentry exported="true" kind="lib" path="main/webapp/WEB-INF/lib/butterfly-1.0.1.jar" sourcepath="main/webapp/WEB-INF/lib-src/butterfly-1.0.1-sources.jar"/> <classpathentry exported="true" kind="lib" path="main/webapp/WEB-INF/lib/butterfly-1.0.1.jar" sourcepath="main/webapp/WEB-INF/lib-src/butterfly-1.0.1-sources.jar"/>
<classpathentry exported="true" kind="lib" path="main/webapp/WEB-INF/lib/clojure-1.4.0.jar"/> <classpathentry exported="true" kind="lib" path="main/webapp/WEB-INF/lib/clojure-1.5.1-slim.jar"/>
<classpathentry exported="true" kind="lib" path="main/webapp/WEB-INF/lib/commons-codec-1.6.jar"/> <classpathentry exported="true" kind="lib" path="main/webapp/WEB-INF/lib/commons-codec-1.6.jar"/>
<classpathentry exported="true" kind="lib" path="main/webapp/WEB-INF/lib/commons-collections-3.2.1.jar"/> <classpathentry exported="true" kind="lib" path="main/webapp/WEB-INF/lib/commons-collections-3.2.1.jar"/>
<classpathentry exported="true" kind="lib" path="main/webapp/WEB-INF/lib/commons-fileupload-1.2.1.jar"/> <classpathentry exported="true" kind="lib" path="main/webapp/WEB-INF/lib/commons-fileupload-1.2.1.jar"/>

View File

@ -40,6 +40,7 @@ import java.util.Properties;
import java.util.Set; import java.util.Set;
import clojure.lang.IFn; import clojure.lang.IFn;
import clojure.lang.RT;
import com.google.refine.grel.Parser; import com.google.refine.grel.Parser;
@ -59,6 +60,10 @@ abstract public class MetaParser {
static final protected Map<String, LanguageInfo> s_languages = new HashMap<String, LanguageInfo>(); static final protected Map<String, LanguageInfo> s_languages = new HashMap<String, LanguageInfo>();
// TODO: We should switch from using the internal compiler class
// final static private Var CLOJURE_READ_STRING = RT.var("clojure.core", "read-string");
// final static private Var CLOJURE_EVAL = RT.var("clojure.core", "eval");
static { static {
registerLanguageParser("grel", "Google Refine Expression Language (GREL)", new LanguageSpecificParser() { registerLanguageParser("grel", "Google Refine Expression Language (GREL)", new LanguageSpecificParser() {
@ -73,10 +78,18 @@ abstract public class MetaParser {
@Override @Override
public Evaluable parse(String s) throws ParsingException { public Evaluable parse(String s) throws ParsingException {
try { try {
// RT.load("clojure/core"); // Make sure RT is initialized
Object foo = RT.CURRENT_NS; // Make sure RT is initialized
IFn fn = (IFn) clojure.lang.Compiler.load(new StringReader( IFn fn = (IFn) clojure.lang.Compiler.load(new StringReader(
"(fn [value cell cells row rowIndex] " + s + ")" "(fn [value cell cells row rowIndex] " + s + ")"
)); ));
// TODO: We should to switch from using Compiler.load
// because it's technically an internal interface
// Object code = CLOJURE_READ_STRING.invoke(
// "(fn [value cell cells row rowIndex] " + s + ")"
// );
return new Evaluable() { return new Evaluable() {
private IFn _fn; private IFn _fn;

Binary file not shown.