Skip to content
This repository has been archived by the owner on Jan 28, 2019. It is now read-only.

Create :jnt reader conditional support #123

Merged
merged 9 commits into from
Apr 4, 2016
Merged

Create :jnt reader conditional support #123

merged 9 commits into from
Apr 4, 2016

Conversation

arrdem
Copy link
Collaborator

@arrdem arrdem commented Apr 3, 2016

This changeset has one primary change: supporting the :jnt conditional clause in addition to :clj.

#?(:cljs "nope" :jnt "w00t" :clj "nope")
;; => "w00t"

#?(:cljs "nope" :clj "still works")
;; => "still works"

Incidental changes to this end include:

  • Upgrading to Java 1.8
  • Providing an interface default implementation of clojure.lang.Seqable/iterator (Java 1.8 feature)
  • Adding clojure.lang.RT/union [set, coll] -> set (used in the reader changes)

Fixes #68

This is a (minimal besides various cleanups) approach to implementing

This has the advantage of simplicity and preserving `:clj` forms and
reading `:jnt` forms. However its behavior not entirely obvious when
both are present. If multiple features match, then the first one wins.

Hence:
  #?(:clj :clj :jnt "nope!") => :clj
  #?(:jnt "Yeeee" :clj "nope!") => "Yeeee"
@arrdem
Copy link
Collaborator Author

arrdem commented Apr 3, 2016

Needs reader tests...

ISeq seq();

default Iterator iterator() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🍷

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🍺

@arrdem
Copy link
Collaborator Author

arrdem commented Apr 4, 2016

:shipit:

@arrdem arrdem merged commit 92aea98 into develop Apr 4, 2016
@arrdem arrdem mentioned this pull request Apr 4, 2016
@arrdem arrdem deleted the feature/68 branch April 4, 2016 03:54
arrdem added a commit that referenced this pull request Apr 9, 2016
Vist 0.2.0 upon the world

This release focuses on fleshing Jaunt out as a separate platform atop
Clojure, adding support for the `.jnt` file extension and the `:jnt`
reader conditional directive. Other changes include the deprecation and
automatic refactoring hinting of `use` and `refer`, the addition of
`^:uses` metadata fo `AFn` instances in support of future static
analysis work and migration to JDK8 for the entire project although few
JDK8 features are used at this time.

- [#131](#131) Add support for `.jnt` files (@arrdem).
  - `load-file` now chooses the first file of `.class`, `.jnt`, `.clj`, `.cljc`.
- [#129](#129) Emit `^:uses` metadata on `Fn` instances (@arrdem).
- [#126](#126) Add reader support for `Infinity`, `NaN` (@arrdem).
- [#123](#123) Add support for `:jnt` in reader conditionals (@arrdem).
  - Update to Java 1.8
  - Implement `java.lang.Iterable` over `clojure.lang.Seqable` using a Java 8 interface default method
  - Add `clojure.lang.RT.union(set, seq):set`
- [#122](#122) Catch and print exceptions encountered loading `user.clj` (@arrdem).
- [#116](#116) Deprecate `clojure.core/refer` (@arrdem).
  - Deprecate `clojure.core/refer`
  - Refactor `clojure.core/refer` to emit a warning describing how to rewrite refer into require.
- [#117](#117) Fix typo in arglists (@arrdem).
- [#112](#112) Self-refactoring use (@arrdem).
  - Add `clojure.core/sift`.
  - Refactor `clojure.core/use` to emit a warning describing how to rewrite use into require/refer.
  - Refactor out uses of `use`.
- [#111](#111) Add a warning when expanding deprecated macros (@arrdem).
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants