Vectors and maps are already functions of their indices and keys, 
respectively. I don't really think it makes sense for other sequence types 
(seqs, lists, etc.) because they aren't naturally associative in the same 
way. Finally, there isn't a Clojure form I'm aware of that allows negative 
indices in the same way eg Python does, but I for one would find that 
incredibly useful.

On Wednesday, June 26, 2013 8:01:02 PM UTC-7, Greg Slepak wrote:
>
> There is one feature that I really miss from newLISP and seems like it 
> could be a natural extension to Clojure, and that is implicit indexing for 
> lists and arrays.
>
> Clojure already has something similar in its use of keywords to act as 
> functions that look themselves up in a map.
>
> This is basically the same concept, but using numbers instead. Implicit 
> indexing creates a really elegant syntax for finding elements and ranges in 
> a list or array. Here's an example:
>
> > (setf mylist '(a b c d e f g))
> (a b c d e f g)
> > (mylist 0)
> a
> > (mylist -1)
> g
> > (0 3 mylist)
> (a b c)
>
>
> Has this been considered already? Would this be something that could be 
> added to the language syntax?
>
> Thanks for your consideration!
>
> Sincerely,
> Greg
>

-- 
-- 
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/groups/opt_out.


Reply via email to