Clojure equivalents of .indexOf .lastIndexOf

419 views
Skip to first unread message

Irakli Gozalishvili

unread,
Feb 28, 2013, 4:49:12 PM2/28/13
to clo...@googlegroups.com
Hi,

I was looking at http://clojure.org/cheatsheet to find something I could use for getting an index of specific
item in the string / vector. It looks like `.indexOf` / `.lastIndexOf` are officially suggested options.

I would prefer to avoid backend specific API like these (as I intend to compile to lua) and was wondering if it's reasonable
to open issue requesting clojure native equivalents. I'd also be happy to provide patches to do it.


Regards
--
Irakli Gozalishvili
Web: http://www.jeditoolkit.com/

Andy Fingerhut

unread,
Feb 28, 2013, 8:24:46 PM2/28/13
to clo...@googlegroups.com
Although the cheat sheet is hosted on clojure.org, I'd hesitate a bit in inferring from its contents that .indexOf and .lastIndexOf are officially suggested options.  More precise would be to say that when I was updating the cheatsheet a year ago to add many things that weren't already on there, it occurred to me that those would be useful for people to know about, even though they could of course write equivalents for themselves.

I'm certainly open to suggestions for those entries on the cheat sheet if there is something better to suggest.  (or any of it at all, really)

If there already are Clojure core or contrib functions that have the same behavior and performance as .indexOf / .lastIndexOf, I'm all ears.

Andy
Reply all
Reply to author
Forward
0 new messages