Skip to content

Commit 7dfe8d2

Browse files
Nuke support for Clojure 1.9
1 parent ea3651f commit 7dfe8d2

File tree

11 files changed

+240
-310
lines changed

11 files changed

+240
-310
lines changed

.circleci/config.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ jobs:
180180
#
181181
# - run tests against the target matrix
182182
# - Java 8, 11, 17, 21, 22
183-
# - Clojure 1.9, 1.10, 1.11, master
183+
# - Clojure 1.10, 1.11, master
184184
# - linter, eastwood and cljfmt
185185

186186
workflows:
@@ -192,8 +192,7 @@ workflows:
192192
alias: "test_code_jdk8"
193193
parameters:
194194
jdk_version: [openjdk8]
195-
# Clojure 1.9 is tested only against JDK8.
196-
clojure_version: ["1.9", "1.10", "1.11", "master"]
195+
clojure_version: ["1.10", "1.11", "master"]
197196
test_profiles: ["-user,-dev,+test,-provided", "-user,-dev,+test,+provided"]
198197
# It doesn't make sense to exercise the newer Orchard Java parsers against JDK8
199198
# (given that JDK8 is explicitly excluded by those parsers)

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ Documentation for the master branch as well as tagged releases are available
7373

7474
## Usage
7575

76-
**orchard requires Clojure 1.8+ and Java 8+.**
76+
**orchard requires Clojure 1.10+ and Java 8+.**
7777

7878
Just add `orchard` as a dependency and start hacking.
7979

doc/inspector.org

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -195,8 +195,8 @@ different kinds of objects.
195195
*** Class
196196

197197
Classes are rendered with their name, the implemented interfaces, the
198-
available constructors, their fields and methods. In Clojure versions
199-
>= 1.10 an optional =Datafy= section is added.
198+
available constructors, their fields and methods, and their datafied
199+
representation.
200200

201201
#+begin_src clojure :exports both :results output :wrap example
202202
(inspect/inspect-print Boolean)
@@ -261,8 +261,6 @@ Since the [[https://github.com/clojure/clojure/blob/master/src/clj/clojure/core/
261261
section will only be rendered if the datafy-ed version of the object
262262
is different than the original object.
263263

264-
Minimum requirement for this feature is a Clojure version >= 1.10.
265-
266264
#+begin_src clojure :exports both :results output :wrap example
267265
(-> {:name "John Doe"}
268266
(with-meta {'clojure.core.protocols/datafy
@@ -430,8 +428,6 @@ optional =Datafy= section. The ='clojure.core.protocols/nav= function
430428
of the object will be used for navigation, instead of the default
431429
implementation declared on object.
432430

433-
Minimum requirement for this feature is a Clojure version >= 1.10.
434-
435431
#+begin_src clojure :exports both :results output :wrap example
436432
(-> {:name "John Doe"}
437433
(with-meta {'clojure.core.protocols/nav

project.clj

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@
3434
[org.clojure/clojure "1.11.2" :classifier "sources"]
3535
[org.clojure/clojurescript "1.11.4"]]
3636
:test-paths ["test-cljs"]}
37-
:1.9 {:dependencies [[org.clojure/clojure "1.9.0"]
38-
[org.clojure/clojure "1.9.0" :classifier "sources"]]}
3937
:1.10 {:dependencies [[org.clojure/clojure "1.10.3"]
4038
[org.clojure/clojure "1.10.3" :classifier "sources"]]}
4139
:1.11 {:dependencies [[org.clojure/clojure "1.11.2"]

src-newer-jdks/orchard/java/parser_utils.clj

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
(ns orchard.java.parser-utils
22
"The common parts to the `parser` and `parser-next` namespaces."
33
{:added "0.15.0"}
4-
(:refer-clojure :exclude [resolve])
54
(:require
65
[clojure.java.io :as io]
76
[clojure.string :as string])
@@ -88,15 +87,6 @@
8887
{:name (-> f .getSimpleName str symbol)
8988
:type (-> f .asType (typesym env))})
9089

91-
(defn- resolve
92-
"Workaround for CLJ-1403, fixed in Clojure 1.10. Once 1.9 support is
93-
discontinued, this function may simply be removed."
94-
[sym]
95-
(try
96-
(clojure.core/resolve sym)
97-
(catch Exception _
98-
nil)))
99-
10090
(defn module-name
10191
"Return the module name, or nil if modular"
10292
[klass]

src/orchard/info.clj

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
(ns orchard.info
22
"Retrieve the info map from var and symbols."
3-
(:refer-clojure :exclude [qualified-symbol?])
43
(:require
54
[clojure.java.io :as io]
65
[orchard.cljs.analysis :as cljs-ana]
@@ -20,15 +19,6 @@
2019
[ns sym]
2120
(when sym (symbol (some-> ns str) (str sym))))
2221

23-
(defn qualified-symbol?
24-
"Return true if `x` is a symbol with a namespace
25-
26-
This is only available from Clojure 1.9 so we backport it until we
27-
drop support for Clojure 1.8."
28-
{:added "0.5"}
29-
[x]
30-
(boolean (and (symbol? x) (namespace x) true)))
31-
3222
(defn normalize-params
3323
"Normalize the info params.
3424

src/orchard/inspect.clj

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,24 +9,14 @@
99
1010
Pretty wild, right?"
1111
(:require
12+
[clojure.core.protocols :refer [datafy nav]]
1213
[clojure.string :as string]
1314
[orchard.misc :as misc]
1415
[orchard.print :as print])
1516
(:import
1617
(java.lang.reflect Constructor Field Method Modifier)
1718
(java.util List Map)))
1819

19-
;; Datafy Nav and tap> are only available since Clojure 1.10
20-
(require 'clojure.core.protocols)
21-
22-
(def ^:private datafy
23-
(misc/call-when-resolved 'clojure.core.protocols/datafy))
24-
25-
(def ^:private nav
26-
(misc/call-when-resolved 'clojure.core.protocols/nav))
27-
28-
(def ^:private maybe-tap>
29-
(misc/call-when-resolved 'clojure.core/tap>))
3020
;;
3121
;; Navigating Inspector State
3222
;;
@@ -272,13 +262,13 @@
272262
(defn tap-current-value
273263
"Tap the currently inspected value."
274264
[inspector]
275-
(maybe-tap> (:value inspector))
265+
(tap> (:value inspector))
276266
(inspect-render inspector))
277267

278268
(defn tap-indexed
279269
"Tap the value found at `idx`, without navigating to it."
280270
[{:keys [index] :as inspector} idx]
281-
(maybe-tap> (get index idx))
271+
(tap> (get index idx))
282272
(inspect-render inspector))
283273

284274
(defn render-onto [inspector coll]
@@ -435,9 +425,7 @@
435425
(map datafy data))))
436426

437427
(defn- render-datafy? [inspector obj]
438-
(cond (not misc/datafy?)
439-
false
440-
(map? obj)
428+
(cond (map? obj)
441429
(not= obj (nav-datafy obj false))
442430
(or (sequential? obj) (set? obj))
443431
(not= (chunk-to-display inspector obj)

src/orchard/java.clj

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -542,9 +542,8 @@
542542
(when (.startsWith classname prefix)
543543
(str url path))))
544544
(into @javadoc/*remote-javadocs*
545-
;; clojure 1.8 has no javadoc for anything beyond java
546-
;; 8. clojure 1.10.1 doesn't have 13. We just backport them
547-
;; regardless of clojure version
545+
;; Older Clojure versions don't have javadoc for newer JDKs.
546+
;; We just backport them regardless of Clojure version.
548547
(zipmap ["java." "javax." "org.ietf.jgss." "org.omg." "org.w3c.dom." "org.xml.sax"]
549548
(repeat (or (javadoc-base-urls misc/java-api-version)
550549
(javadoc-base-urls 11))))))

src/orchard/misc.clj

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -160,16 +160,6 @@
160160
(catch Exception _ nil)))
161161
(some-> sym find-var var-get)))
162162

163-
(def datafy?
164-
"True if Datafy and Nav (added in Clojure 1.10) are supported,
165-
otherwise false."
166-
(some? (resolve 'clojure.core.protocols/datafy)))
167-
168-
(def tap?
169-
"True if tap> (added in Clojure 1.10) is supported,
170-
otherwise false."
171-
(some? (resolve 'clojure.core/tap>)))
172-
173163
(defn call-when-resolved
174164
"Return a fn that calls the fn resolved through `var-sym` with the
175165
arguments passed to it. `var-sym` will be required and resolved

src/orchard/xref.clj

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,6 @@
88
[clojure.string :as string]
99
[orchard.query :as q]))
1010

11-
(defn- var->symbol
12-
;; TODO: use `symbol` once we start targeting Clojure >= 1.10 after CIDER 1.8 is released.
13-
"Normally one could just use `(symbol var-ref)`,
14-
but that doesn't work in older Clojures."
15-
[var-ref]
16-
(let [{:keys [ns name]} (meta var-ref)]
17-
(symbol (str (ns-name ns))
18-
(str name))))
19-
2011
(defn- var->fn [var-ref]
2112
(let [{:keys [test]} (meta var-ref)]
2213
(if (fn? test)
@@ -99,7 +90,7 @@
9990
;; group duplicates. This is important
10091
;; because there can be two seemingly equal #'foo.bar/baz var objects in the result.
10192
;; That can happen as one re-evaluates code and the old var hasn't been GC'd yet.
102-
(keys (group-by var->symbol result))))))
93+
(keys (group-by symbol result))))))
10394

10495
(defn fn-transitive-deps
10596
"Returns a set with all the functions invoked inside `v` or inside those functions.

0 commit comments

Comments
 (0)