Skip to content

Commit 96bdcae

Browse files
committed
made AStream Sequential
made *io-context* public
1 parent 0859070 commit 96bdcae

File tree

3 files changed

+15
-4
lines changed

3 files changed

+15
-4
lines changed

src/clj/clojure/core.clj

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1299,7 +1299,7 @@
12991299
(. ref (touch))
13001300
(. ref (get)))
13011301

1302-
(def #^{:private true :tag clojure.lang.Closer} *io-context* nil)
1302+
(def #^{:tag clojure.lang.Closer} *io-context* nil)
13031303

13041304
(defmacro sync
13051305
"transaction-flags => TBD, pass nil for now
@@ -1437,6 +1437,17 @@
14371437
eos
14381438
(apply f xs)))))))))
14391439

1440+
(defn map
1441+
"Returns a lazy seq consisting of the result of applying f to the
1442+
set of first items of each coll, followed by applying f to the set
1443+
of second items in each coll, until any one of the colls is
1444+
exhausted. Any remaining items in other colls are ignored. Function
1445+
f should accept number-of-colls arguments."
1446+
([f coll] (seq (map-stream f coll)))
1447+
([f c1 c2] (seq (map-stream f c1 c2)))
1448+
([f c1 c2 c3] (seq (map-stream f c1 c2 c3)))
1449+
([f c1 c2 c3 & colls] (seq (apply map-stream f c1 c2 c3 colls))))
1450+
14401451
(defn mapcat
14411452
"Returns the result of applying concat to the result of applying map
14421453
to f and colls. Thus function f should return a collection."

src/jvm/clojure/lang/AStream.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
package clojure.lang;
1414

15-
final public class AStream implements Seqable, Streamable {
15+
final public class AStream implements Seqable, Streamable, Sequential {
1616

1717
static final ISeq NO_SEQ = new Cons(null, null);
1818

src/jvm/clojure/lang/RT.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -720,7 +720,7 @@ else if(n == 1)
720720

721721
else if(coll instanceof Sequential)
722722
{
723-
ISeq seq = ((IPersistentCollection) coll).seq();
723+
ISeq seq = RT.seq(coll);
724724
coll = null;
725725
for(int i = 0; i <= n && seq != null; ++i, seq = seq.rest())
726726
{
@@ -783,7 +783,7 @@ else if(n == 1)
783783
}
784784
else if(coll instanceof Sequential)
785785
{
786-
ISeq seq = ((IPersistentCollection) coll).seq();
786+
ISeq seq = RT.seq(coll);
787787
coll = null;
788788
for(int i = 0; i <= n && seq != null; ++i, seq = seq.rest())
789789
{

0 commit comments

Comments
 (0)