Arc Forumnew | comments | leaders | submitlogin
2 points by thaddeus 5605 days ago | link | parent

I know I requested a reverse for a while back.

http://arclanguage.org/item?id=9192

I use it for a few scenarios... example reversing through the keys of a table where they are numeric.



1 point by palsecam 5605 days ago | link

Thanks a lot for the link Thaddeus!

Quoting CatDancer:

> I think that would get me in trouble sometimes...

Yes, I can also see cases where this behaviour would be problematic.

However, I'm nearly sure if I hadn't have to look at arc.arc to modify 'for, I'd have never know of 'down.

And the day I would have the need for a reverse 'for, I'd have try in the REPL (for i n+m n), see it doesn't work, and then say to myself "OK, Arc is one of those language where the programmer has to make sure the bounds are in the right order in 'for", and I would have code a little thing to ensure that.

BUT, and CatDancer is very right, on the other hand, if you have 'for working also in descendant order, then it's "OK, Arc is one of those language where the programmer has to test the bounds of 'for if in a situation where he can't be sure the expected "max" will effectively be > to the "min"".

Trade-off, trade-off, trade-off everywhere. Is the overload of knowing yet another loop construct interesting enough because then you don't have to manually test the bounds where you're not sure what they'll be, or is it the inverse? I guess there is no universal answer to this...

-----