Skip to content

Instantly share code, notes, and snippets.

View hdurer's full-sized avatar

H Durer hdurer

  • No longer in South-east England
View GitHub Profile
### Keybase proof
I hereby claim:
* I am hdurer on github.
* I am hdurer (https://keybase.io/hdurer) on keybase.
* I have a public key whose fingerprint is DADC 623F 816C EFF7 BC50 E490 9E83 FD8E 9475 0DE4
To claim this, I am signing this object:
Verifying that +hdurer is my openname (Bitcoin username). https://onename.com/hdurer

Keybase proof

I hereby claim:

  • I am hdurer on github.
  • I am hdurer (https://keybase.io/hdurer) on keybase.
  • I have a public key whose fingerprint is ACB2 39D1 8AC7 44D9 9D7A F3E4 215E FC25 546A D3CC

To claim this, I am signing this object:

(defn reverse-digits
"Reverse the digits of a given number without using string functions"
([n]
(reverse-digits n 10))
([n base]
(->> [n []]
;; split n into a sequence of [rest-to-split digits-so-far]
(iterate (fn [[x digits]]
[(quot x base) (cons (rem x base) digits)]))
;; drop the elements not fully split up
--- trunk/src/clojure/contrib/lazy_seqs.clj (revision 452)
+++ trunk/src/clojure/contrib/lazy_seqs.clj (working copy)
@@ -75,13 +75,15 @@
(list nil)))
(defn partition-all
- "Lazily break s into chunks of length n (or less, for the
+ "Lazily break coll into chunks of length n (or less, for the
final chunk)."
- [n s]