-
Notifications
You must be signed in to change notification settings - Fork 3
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
Categorize cljs.core forms #11
Comments
Good start: http://clojuredocs.org/quickref and http://cljs.info/cheatsheet/ |
It would also be nice to add a meta that differentiate the evaluation, whether it's strict or lazy. Could be simply called :evaluation with values #{:strict :lazy}. |
like the difference between |
Sincerely no idea, I actually counted on your knowledge to enlighten me ;)
To be honest, all data literals (and equivalent API) are strict. We
stumbled upon this fact when comparing the following :
``` clojure
(->> (range 10)
(map #(do (println "map") (inc %)))
(filter #(do (println "filter") (odd? %)))
(take 3)
println)
;; All lazy, will print 3 "map filter" then the result
(->> [1 2 3 4 5]
(map #(do (println "map") (inc %)))
(filter #(do (println "filter") (odd? %)))
(take 3)
println)
;; Strict, will first print 3 "map" then 3 "filter" then the result
```
So in a sense some API of Clojure(Script) are strict. It's not a completely
lazy language like Haskell. Only the sequence API is lazy I suppose, but I
don't know in details.
Maybe worth investigating and documenting ?
…On Jul 27, 2017 15:11, "Shaun Lebron" ***@***.***> wrote:
like the difference between map/filter and mapv/filterv? I think most
things generate lazy sequences, can you list the ones that you know are
"strict"?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#11 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAEt3s3GQnAax5gIkdEW_2ykHQkq4KV9ks5sSIx2gaJpZM4JlSIS>
.
|
(written from a phone, sorry for bad indentation and possible typos) |
Yeah, in that case, I think it's good to categorize just the "strict" ones. Like |
I think this official page can start as a good guide to find more :
https://clojure.org/reference/lazy
Not sure that "only strict" will suffice. For my part I need to read and
test more to truly understand where the distinction lies.
…On Jul 27, 2017 21:56, "Shaun Lebron" ***@***.***> wrote:
Yeah, in that case, I think it's good to categorize just the "strict"
ones. Like doall, filterv, mapv, and maybe even doseq and run!, and
others we can try to find.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#11 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAEt3jFIqkDJmkiwqohVJWIkbVMQoZITks5sSOtUgaJpZM4JlSIS>
.
|
Core is such a mish-mash that it needs categories to make it traversable.
The text was updated successfully, but these errors were encountered: