What does `empty` do for non-collection types?:

(empty 1) => nil
(empty "123") => nil
(empty :abc) => nil
(empty (clojure.lang.MapEntry. "a" 1))

So it is actually very consistent.


On Fri, Jul 18, 2014 at 6:06 PM, Brian Craft <craft.br...@gmail.com> wrote:

> hm, looks even more broken in the context of these examples.
>
>
> On Friday, July 18, 2014 5:04:34 AM UTC-7, Mike Fikes wrote:
>>
>> My guess: Perhaps this is a bug, or alternatively, a known issue that
>> won't be addressed because to do so would be a breaking change.
>>
>> There is an old demo of Clojure given by Rich where MapEntry's were
>> printed using some sort of un-readable notation #<:foo 5>. But clearly
>> MapEntry's have been revised to act a lot like 2-element vectors.
>>
>> user=> (rseq (first (mapv identity {:foo 5})))
>>
>> (5 :foo)
>>
>> user=> (conj (first (mapv identity {:foo 5})) :x)
>>
>> [:foo 5 :x]
>>
>> user=> (assoc (first (mapv identity {:foo 5})) 1 7)
>>
>> [:foo 7]
>>
>> user=> (subvec (first (mapv identity {:foo 5})) 0 1)
>>
>> [:foo]
>>
>>
>> FWIW, ClojureScript behaves in your expected way:
>>
>>
>> (empty (first (mapv identity {:foo 5})))
>>
>> => []
>>
>  --
> 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.
>

-- 
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