Skip to content

Commit

Permalink
revisit direct linking
Browse files Browse the repository at this point in the history
  • Loading branch information
richhickey committed Jul 28, 2015
1 parent 8383026 commit 309c030
Show file tree
Hide file tree
Showing 5 changed files with 221 additions and 108 deletions.
3 changes: 2 additions & 1 deletion build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@
<sysproperty key="clojure.compile.path" value="${build}"/>
<!--<sysproperty key="clojure.compiler.elide-meta" value="[:doc :file :line :added]"/>-->
<!--<sysproperty key="clojure.compiler.disable-locals-clearing" value="true"/>-->
<!-- <sysproperty key="clojure.compile.warn-on-reflection" value="true"/> -->
<!--<sysproperty key="clojure.compile.warn-on-reflection" value="true"/>-->
<sysproperty key="clojure.compiler.direct-linking" value="true"/>
<sysproperty key="java.awt.headless" value="true"/>
<arg value="clojure.core"/>
<arg value="clojure.core.protocols"/>
Expand Down
4 changes: 3 additions & 1 deletion clojure.iml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
<component name="FacetManager" />
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_6" inherit-compiler-output="false">
<output url="file://$MODULE_DIR$/target/classes" />
<output-test url="file://$MODULE_DIR$/target/test-classes" />
Expand All @@ -20,4 +21,5 @@
<orderEntry type="library" scope="TEST" name="Maven: org.clojure:data.generators:0.1.2" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.clojure:test.check:0.5.9" level="project" />
</component>
</module>
</module>

13 changes: 7 additions & 6 deletions src/clj/clojure/core.clj
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,11 @@
conj (fn ^:static conj
([] [])
([coll] coll)
([coll x] (. clojure.lang.RT (conj coll x)))
([coll x] (clojure.lang.RT/conj coll x))
([coll x & xs]
(if xs
(recur (conj coll x) (first xs) (next xs))
(conj coll x)))))
(recur (clojure.lang.RT/conj coll x) (first xs) (next xs))
(clojure.lang.RT/conj coll x)))))

(def
^{:doc "Same as (first (next x))"
Expand Down Expand Up @@ -188,9 +188,9 @@
:static true}
assoc
(fn ^:static assoc
([map key val] (. clojure.lang.RT (assoc map key val)))
([map key val] (clojure.lang.RT/assoc map key val))
([map key val & kvs]
(let [ret (assoc map key val)]
(let [ret (clojure.lang.RT/assoc map key val)]
(if kvs
(if (next kvs)
(recur ret (first kvs) (second kvs) (nnext kvs))
Expand Down Expand Up @@ -317,7 +317,8 @@
(list 'def (with-meta name m)
;;todo - restore propagation of fn name
;;must figure out how to convey primitive hints to self calls first
(cons `fn fdecl) ))))
;;(cons `fn fdecl)
(with-meta (cons `fn fdecl) {:rettag (:tag m)})))))

(. (var defn) (setMacro))

Expand Down
Loading

0 comments on commit 309c030

Please sign in to comment.