-
Notifications
You must be signed in to change notification settings - Fork 32
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
Why is there no first? #39
Comments
You are lookings for
|
Thanks for pointing out the (require
'[net.cgrand.xforms :as x]
'[net.cgrand.xforms.rfs :as rfs])
(into {} (x/by-key identity rfs/last) [1 2 3 4]) ;; => {1 1, 2 2, 3 3, 4 4}
(into {} (x/by-key identity x/last) [1 2 3 4]) ;; => {1 1, 2 2, 3 3, 4 4}
(into {} (x/by-key identity rfs/some) [1 2 3 4]) ;; => {1 1, 2 2, 3 3, 4 4}
;; (into {} (x/by-key identity x/some) [1 2 3 4]) ;; throws 'Wrong number of args (1) passed to: net.cgrand.xforms/some' Also: (reduce rfs/last [1 2 3 4]) ;; => 4
(reduce rfs/some [1 2 3 4]) ;; => returns 2; I'd expect 1
(x/some identity [1 2 3 4]) ;; => 1
(x/last identity [1 2 3 4]) ;; throws 'Wrong number of args (2) passed to: net.cgrand.xforms/reduce/fn--35656' And here I'd expect same types: (type (rfs/last identity [1 2 3 4])) ;; => clojure.lang.PersistentVector
(type (rfs/some identity [1 2 3 4])) ;; => clojure.lang.Reduced |
(reduce rfs/some [1 2 3 4]) ;; => returns 2; I'd expect 1
(transduce identity rfs/some [1 2 3 4]) ;; => returns 1
=> (into [] x/last [1 2 3 4])
[4]
=> (x/some x/last [1 2 3 4])
4 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I wonder what's the reason behind not having:
? as a "complement" of
last
.Edit:
Huh, interestingly enough it won't work at all:
I'm getting convinced this issue can be closed. Happy Xmas! :)
The text was updated successfully, but these errors were encountered: