Created
January 1, 2016 06:26
-
-
Save mfikes/ef1b535ab41d1e706a5c to your computer and use it in GitHub Desktop.
realized? for lazy seq in ClojureScript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From 705930227b34365b95480941ee085f2e5a4e2a63 Mon Sep 17 00:00:00 2001 | |
From: Mike Fikes <mike@fikesfarm.com> | |
Date: Fri, 1 Jan 2016 01:24:34 -0500 | |
Subject: [PATCH] Experiment: realized? for lazy seq | |
--- | |
src/main/cljs/cljs/core.cljs | 4 ++++ | |
1 file changed, 4 insertions(+) | |
diff --git a/src/main/cljs/cljs/core.cljs b/src/main/cljs/cljs/core.cljs | |
index c6ca522..f6db702 100644 | |
--- a/src/main/cljs/cljs/core.cljs | |
+++ b/src/main/cljs/cljs/core.cljs | |
@@ -3014,6 +3014,10 @@ reduces them without incurring seq initialization" | |
(set! fn nil) | |
s))) | |
+ IPending | |
+ (-realized? [d] | |
+ (nil? fn)) | |
+ | |
IWithMeta | |
(-with-meta [coll meta] (LazySeq. meta fn s __hash)) | |
-- | |
2.5.4 (Apple Git-61) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment