Everyman a écrit :
> I have been reading through the API examples on:
> http://en.wikibooks.org/wiki/Clojure_Programming/Examples/API_Examples.
>
> For memfn we have:
>
> (map (memfn charAt i) ["fred" "ethel" "lucy"] [1 2 3])
> -> (\r \h \y)
>
> This still works, but I thought that:  charAt aught to be .charAt
> following the new Java call changes.
>
> Thoughts?
>   

memfn predates anonymous function literals. I think it's better to use 
#(.charAt % i) than (memfn charAt i).

Plus memfn won't let you add type hints on you arg so you can't avoid 
reflective calls.
  #(.charAt #^String % i)

Christophe

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

Reply via email to