tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hls...@apache.org
Subject git commit: Update Clojure to 1.6.0
Date Fri, 01 Aug 2014 22:04:33 GMT
Repository: tapestry-5
Updated Branches:
  refs/heads/master b83918998 -> 25389db3c


Update Clojure to 1.6.0


Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/25389db3
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/25389db3
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/25389db3

Branch: refs/heads/master
Commit: 25389db3c39946f39bbe4e6ce8d09c7e24ded581
Parents: b839189
Author: Howard M. Lewis Ship <hlship@apache.org>
Authored: Fri Aug 1 15:04:37 2014 -0700
Committer: Howard M. Lewis Ship <hlship@apache.org>
Committed: Fri Aug 1 15:04:37 2014 -0700

----------------------------------------------------------------------
 tapestry-clojure/build.gradle                     |  2 +-
 .../internal/clojure/ClojureBuilderImpl.java      | 18 ++++++++----------
 2 files changed, 9 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/25389db3/tapestry-clojure/build.gradle
----------------------------------------------------------------------
diff --git a/tapestry-clojure/build.gradle b/tapestry-clojure/build.gradle
index 2366a91..77111c6 100644
--- a/tapestry-clojure/build.gradle
+++ b/tapestry-clojure/build.gradle
@@ -2,7 +2,7 @@ description = "Allows Clojure functions to be injected into Tapestry services
an
 
 dependencies {
   compile project(':tapestry-ioc')
-  compile "org.clojure:clojure:1.5.1"
+  compile "org.clojure:clojure:1.6.0"
 
   // Added just to prove that it works (TAP5-1945)
   testCompile project(':tapestry-core')

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/25389db3/tapestry-clojure/src/main/java/org/apache/tapestry5/internal/clojure/ClojureBuilderImpl.java
----------------------------------------------------------------------
diff --git a/tapestry-clojure/src/main/java/org/apache/tapestry5/internal/clojure/ClojureBuilderImpl.java
b/tapestry-clojure/src/main/java/org/apache/tapestry5/internal/clojure/ClojureBuilderImpl.java
index 1d6184a..2e42946 100644
--- a/tapestry-clojure/src/main/java/org/apache/tapestry5/internal/clojure/ClojureBuilderImpl.java
+++ b/tapestry-clojure/src/main/java/org/apache/tapestry5/internal/clojure/ClojureBuilderImpl.java
@@ -1,5 +1,3 @@
-// Copyright 2012-2013 The Apache Software Foundation
-//
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
 // You may obtain a copy of the License at
@@ -14,10 +12,9 @@
 
 package org.apache.tapestry5.internal.clojure;
 
+import clojure.java.api.Clojure;
 import clojure.lang.IFn;
-import clojure.lang.RT;
 import clojure.lang.Symbol;
-import clojure.lang.Var;
 import org.apache.tapestry5.clojure.ClojureBuilder;
 import org.apache.tapestry5.clojure.MethodToFunctionSymbolMapper;
 import org.apache.tapestry5.clojure.Namespace;
@@ -37,7 +34,7 @@ public class ClojureBuilderImpl implements ClojureBuilder
 
     private final OperationTracker tracker;
 
-    private final Var REQUIRE = RT.var("clojure.core", "require");
+    private final IFn REQUIRE = Clojure.var("clojure.core", "require");
 
     public ClojureBuilderImpl(@Builtin PlasticProxyFactory proxyFactory, MethodToFunctionSymbolMapper
mapper, OperationTracker tracker)
     {
@@ -93,20 +90,21 @@ public class ClojureBuilderImpl implements ClojureBuilder
                     @Override
                     public void run()
                     {
+
                         Symbol namespaceSymbol = Symbol.create(symbol.getNamespace());
 
                         REQUIRE.invoke(namespaceSymbol);
 
-                        Var var = Var.find(symbol);
+                        IFn clojureFunction = Clojure.var(symbol);
 
-                        final PlasticField varField = plasticClass.introduceField(Var.class,
method.getName() + "Var").inject(var);
+                        final PlasticField fnField = plasticClass.introduceField(IFn.class,
method.getName() + "IFn").inject(clojureFunction);
 
                         plasticClass.introduceMethod(desc).changeImplementation(new InstructionBuilderCallback()
                         {
                             @Override
                             public void doBuild(InstructionBuilder builder)
                             {
-                                bridgeToClojure(builder, desc, varField);
+                                bridgeToClojure(builder, desc, fnField);
                             }
                         });
 
@@ -115,9 +113,9 @@ public class ClojureBuilderImpl implements ClojureBuilder
 
             }
 
-            private void bridgeToClojure(InstructionBuilder builder, MethodDescription description,
PlasticField varField)
+            private void bridgeToClojure(InstructionBuilder builder, MethodDescription description,
PlasticField ifnField)
             {
-                builder.loadThis().getField(varField);
+                builder.loadThis().getField(ifnField);
 
                 int count = description.argumentTypes.length;
 


Mime
View raw message