A `swap!` returns the new value of the atom.
Favor destructuring over repeated queries.
Just pulling comments onto their own line.

I prefer this, but it's certainly not necessary. I'm just doing it
because I view code split-screen, and so like to keep an ~80-char limit
on line size.
Fix destructuring typo.
`single?` fn and the sequence abstraction.

I noticed a lot of `(= 1 (count path))` throughout the codebase, and so
introduced a `single?`, if only to reduce the parentheses clutter. Here,
I've only used it on these two forms, but I'll start using it wherever I
can as I move through the codebase.

Second, we can recur on the `rest` of the path, instead of using a
subvec, because we only rely on the sequence abstraction, not on the
paths being vectors.
A touch of destructuring.

This is just a general cleanup -- nothing to see here.

Oh, wait! I changed `and` to `when` in `ancestor?`, even though they do
the same thing here. I just think that `when` is more descriptive and
reads a bit better, making it possible to remove the two comments.
Keywords are functions, and so can be mapped.

This is a nice trick. `(:k {:k :v})` returns `:v`, as keywords can be
used as functions in Clojure. So, we can simply map `:branch` over the
two paths instead of needing a `for` and destructuring.
Clean up docstring. Nothin' to see here.
Keyword fns, `empty?`, and multiple `conj` args.

Oh my!

- We don't need an anonymous fn for `filter`, because `:branch` does the
  job.
- There's no need to vectorize the `filter` at this point. (We do that
  later.)
- `[newnode]` seems a bit more clear than `(list newnode)`.
- `conj` can accept multiple arguments, so we don't need to double it.
`cond` formatting and some cleanup.

A few things here:

- A `rootnode` fn is more descriptive than `[(pathnode nil)]`.
- The second and third clauses of the cond were redundant, and so they
  were moved into a single clause. Also, `(not (nil? foo))` is sometimes
  better represented as `(seq foo)`, which returns a lazy-seq if foo has
  items in it (truthy) and `nil` otherwise (falsey).
- The second `ancestor?` check and the `:else` clause were redundant, so
  I let it fall back on the else. Of course, I may be missing something
  :).
- Finally, for long `cond` forms, I prefer this style of formatting.
Simplify with destructuring and `seq`.

Also, the `seq` wrapping `drop-while` was unnecessary, I think. :)
Use `filter` instead of `for`.

Pretty much whenever you're just using the `:when` clause of a `for`,
what you might actually be looking for is `filter`.

We can also make this more more concise with a `map`, some
destructuring, and a new function `in`.
`seq-diff` and simplifications.

A good few changes here:

- `seq-diff` seems handy, and DRYed up some code in `join` and
  `remove-set`.
- Another switch to a `filter` from a `for` that I think makes things
  more clear and concise.
- Instead of `(apply sorted-set-by item<? ...)`, you can take advantage
  of your `ordered-set` fn and use `into`.
An example of a type implementing core interfaces.

This is the last thing I want to introduce, because it's pretty neat,
but how you do it is not made clear in any documentation I've found.
This is an example of a silly type `Foo` implementing core interfaces
that are defined in Java. In order to do this, you must use a `deftype`
instead of `defrecord`, which means you lose all of the "treat your
object like a map" goodness, but you gain a bit of power.

This `Foo` type will respond to numerous built-in Clojure functions: I
can map, filter, or reduce over it; I can conj onto it; I can disj items
from it (it's assumed that it's instantiated with a set); I can ask if
it contains? anything; I can turn it into a seq; I can empty it; et al.
One function I didn't implement, but that you should, is `(equiv [self
o])`, in the IPersistentCollection interface, that will handle equality.

So, this would be a pretty cool thing for OrderedSet to do -- instead of
having an `oset-insert` and `oset-remove`, you'd just conj and disj on
it like any other set. Cool!