-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Seqs get
caching behaviour & API
#263
Comments
Good suggestion. I think default to no cache is still best to make chaining operations easier to build, but a cacheGets could be pretty interesting |
@leebyron what do you mean by
How does it make chaining operations easier? Also, what is the difference between calling Would you be interested in pull request doing auto-cache of Seq as it gets lazy evaluated? |
I would be happy to look at that PR! |
Great! I will work on it. |
Just spent the better part of an hour scratching my head with a Heisenbug caused by this... or rather, by my assumption that it worked the same as in Clojure. :) 👍 for auto-caching Seq's! I also don't quite get this part in the docs:
|
Sounds like the discussion in this issue has concluded so I am going to close it. Thanks folks! |
@lacker Is there a follow-up discussion somewhere? Implicit auto-caching is still a missing feature. |
Edit: Sorry, didn't see the
cacheResult
function, so turning this into a new issue.Clojure auto caches
seq.get(i)
. I think this is a better solution than to either explicitly callcacheResult
or never cache, for 2 reasons:cacheResult
force evaluates the whole seq which kinda defeats the purpose of lazy evaluation (I can't use it, my stream is infinite). I think clojure's "cache as you go" approach is much better, whether we make the caching explicit or not (I'm for the latter).The text was updated successfully, but these errors were encountered: