On Apr 27, 4:26 pm, Boris Mizhen <bo...@boriska.com> wrote:
> Hello all,
> It seems to me that areduce can not be used with an anonymous array.
> Consider:
>
> (areduce (.. System getProperties values toArray) i r 0
> (some_expression))
>
> It seems to me that there is no way to get i'th element of the array
> in (some_expression) other than let'-ing it first.
> It would be nice to be able to pass the name for the current element
> or define a local macro that expands to
> (aref #a i) - here #a is a gensym for the array itself ...
>
> Thought?
>

Yes, areduce would be nicer if it looked like a binding set:

(areduce [aname anarray, ret init] expr)
(areduce [aname anarray, ret init, start-idx  start-n] expr)
(areduce [aname anarray, ret init, start-idx  start-n, end-idx end-n]
expr)

Treating amap similarly is slightly different since you don't supply
an initial value for ret.

You can put up an issue for this if you like.

Rich

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