On 19 June 2016 at 00:07, Olek <aleksander.nas...@gmail.com> wrote:
>
> Now lets talk about "difficulties" which I have found.
> For example when we talk about removing element from collection.
>
> Why there is no one operation which could behave the same for set, vector,
> list, string, and map? Let the community talk by themselves:
> http://stackoverflow.com/questions/28844647/why-are-disj-and-dissoc-distinct-functions-in-clojure
>

I guess the difference is intent, but you'd have to ask Rich.


> Why there is no one operation for checking if an element is in a
> collection/keys of map/string?
>
> http://stackoverflow.com/questions/3249334/test-whether-a-list-contains-a-specific-value-in-clojure
>

You can use "some" to achieve this effect for most collections. Maps are a
little tricky, because you could be checking for the existence of a key, a
value, or a key-value pair.

It might be nice to have an "includes?" function, though, particularly one
that was more efficient.


> There is no even simple method for saying that element is not a nil. This
> requires from me the (not (nil? %)) combo.
>

There is. "clojure.core/some?" is the same as #(not (nil? #)).

- James

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to