On Friday, October 16, 2015 at 3:32:43 AM UTC-5, Pierre-Yves Ritschard 
wrote:
>
> Hi Mike, 
>
> The code at here seems to contradict you: 
>
> https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/APersistentVector.java#L448-L460,
>  
>
> as does "(key [:a :b])" in the REPL. 
>
> The only limitation is that vectors need to be of size two to act as 
> IMapEntries (otherwise an IllegalOperation exception is thrown). 
>
> The change seems logical and allows key & val to be used more generically. 
>
> You're right that will fail on code that checks for (instance? IMapEntry). 
>

APersistentVector implements IMapEntry, so this doesn't seem correct.
 

> A good alternative - paging Alex Miller - could be for (empty) on a 
> MapEntry to return an empty PersistentVector instead of nil, which would 
> ensure that calls to (into (empty <map-entry>) (map f <map-entry>)) 
> would return a valid map entry (instead of a collection). 
>

It does not make sense to me for empty on a MapEntry to do what you ask 
(for similar reasons why empty on a record is not allowed).
 

> I'm happy to create a ticket for this use-case if deemed valid. 
>
> Cheers, 
>   - pyr 
>
>
>
> On 10/16/2015 01:28 AM, Mike Rodriguez wrote: 
> > Someone else looked at the issue on 
> https://github.com/ztellman/riddley/issues/18 
> > 
> > This issue makes the current version of riddley, and therefore potemkin, 
> not work on Clojure 1.8 beta1 
> > 
> > There is a pull request to fix it at 
> https://github.com/ztellman/riddley/pull/19 
> > 
> > However I am wondering if it is going to affect more places. The problem 
> is that in Clojuee 1.8 APersistentVector now implements IMapEntry 
> (therefore j.u.Map$Entry as well), but it doesn't implement the key or val 
> methods. 
> > What is the reason for that change and/or is this a desired side effect 
> of the change? 
> > 
>

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