Skip to content

Commit 981937b

Browse files
committed
Merge branch 'develop'
2 parents 9fca2d5 + f61fb07 commit 981937b

File tree

8 files changed

+51
-21
lines changed

8 files changed

+51
-21
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @danielcompton

.travis.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
language: clojure
2-
lein: lein2
3-
script: lein2 testall
2+
script: lein testall
3+
jdk:
4+
- oraclejdk8
5+
- oraclejdk11
6+
- openjdk-ea

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Changelog
2+
All notable changes to this project will be documented in this file.
3+
4+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6+
7+
## Unreleased
8+
9+
10+
11+
## 0.11.6 - 2018-12-07
12+
13+
### Fixed
14+
- Fix lazy-loop's support for destructured bindings

README.md

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
1-
[![Build Status](https://secure.travis-ci.org/flatland/useful.png)](http://travis-ci.org/flatland/useful)
1+
# Useful
2+
3+
A collection of generally-useful Clojure utility functions.
4+
5+
[![Build Status](https://www.travis-ci.org/clj-commons/useful.svg)](https://www.travis-ci.org/clj-commons/useful)
26

37
![lein dependency](https://clojars.org/org.flatland/useful/latest-version.svg)
48

5-
These two repositories are usually identical:
9+
[![cljdoc badge](https://cljdoc.org/badge/org.flatland/useful)](https://cljdoc.org/d/org.flatland/useful/CURRENT)
10+
11+
## History
612

7-
* https://github.com/amalloy/useful
8-
* https://github.com/flatland/useful
13+
useful was originally created by [Alan Malloy](https://github.com/amalloy) and was part of the [flatland](https://github.com/flatland) organisation. In December 2018 it was moved to CLJ Commons for continued maintenance.
914

10-
The first is the canonical one. Fixes tend to appear there first, and
11-
that is the preferred repository for filing issues on Github. Fixes
12-
are backported to the second one periodically.
15+
It could previously be found at [amalloy/useful](https://github.com/amalloy/useful) and [flatland/useful](https://github.com/flatland/useful). [clj-commons/useful](https://github.com/clj-commons/useful) is the canonical repository now.

project.clj

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
1-
(defproject org.flatland/useful "0.11.5"
1+
(defproject org.flatland/useful "0.11.6-SNAPSHOT"
22
:description "A collection of generally-useful Clojure utility functions"
33
:license {:name "Eclipse Public License - v 1.0"
44
:url "http://www.eclipse.org/legal/epl-v10.html"
55
:distribution :repo}
66
:url "https://github.com/amalloy/useful"
7-
:dependencies [[org.clojure/clojure "1.6.0"]
7+
:dependencies [[org.clojure/clojure "1.9.0"]
88
[org.clojure/tools.macro "0.1.1"]
99
[org.clojure/tools.reader "0.7.2"]]
10-
:aliases {"testall" ["with-profile" "dev,default:dev,1.3,default:dev,1.4,default:dev,1.5,default:dev,1.7,default" "test"]}
11-
:profiles {:1.7 {:dependencies [[org.clojure/clojure "1.7.0-alpha2"]]}
12-
:1.5 {:dependencies [[org.clojure/clojure "1.5.1"]]}
13-
:1.4 {:dependencies [[org.clojure/clojure "1.4.0"]]}
14-
:1.3 {:dependencies [[org.clojure/clojure "1.3.0"]]} }
10+
:aliases {"testall" ["with-profile" "1.6:1.7:1.8:1.9:1.10" "test"]}
11+
:profiles {:1.10 {:dependencies [[org.clojure/clojure "1.10.0-RC3"]]}
12+
:1.9 {}
13+
:1.8 {:dependencies [[org.clojure/clojure "1.8.0"]]}
14+
:1.7 {:dependencies [[org.clojure/clojure "1.7.0"]]}
15+
:1.6 {:dependencies [[org.clojure/clojure "1.6.0"]]}}
1516
:plugins [[codox "0.8.0"]]
1617
:codox {:src-dir-uri "http://github.com/flatland/useful/blob/develop/"
1718
:src-linenum-anchor-prefix "L"})

src/flatland/useful/seq.clj

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,11 @@
117117
need any laziness."
118118
[bindings & body]
119119
(let [f 'lazy-recur
120-
[names values] (alternates bindings)]
121-
`(letfn [(~f [~@names]
120+
[names values] (alternates bindings)
121+
blob-names (repeatedly (count names) gensym)]
122+
`(letfn [(~f [~@blob-names]
122123
(lazy-seq
123-
(iter# ~@names)))
124+
(iter# ~@blob-names)))
124125
(iter# [~@names]
125126
~@body)]
126127
(~f ~@values))))

test/flatland/useful/debug_test.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
(ns flatland.useful.debug-test
2-
(use flatland.useful.debug clojure.test))
2+
(:use flatland.useful.debug clojure.test))
33

44
(defmacro test-? [form]
55
`(let [form# '~form

test/flatland/useful/seq_test.clj

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,14 @@
9898
(testing "0-arg lazy-loop"
9999
(is (= [1 1 1] (take 3
100100
(lazy-loop []
101-
(cons 1 (lazy-recur))))))))
101+
(cons 1 (lazy-recur)))))))
102+
(testing "destructuring support"
103+
(is (= (range 1 6)
104+
((fn my-map [f xs] (lazy-loop [[x & xs :as coll] xs]
105+
(when (seq coll)
106+
(cons (f x)
107+
(lazy-recur xs)))))
108+
inc (range 5))))))
102109

103110
(deftest test-alternates
104111
(is (= '[[a b] [1 2]]

0 commit comments

Comments
 (0)