You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In release 2.5.0, vararg functions were added. The argument list passed to a function can only be accessed through list iteration loops (for now), which only supports accessing the elements in their given order.
It might be useful to be able to also iterate through the values in a reversed order, perhaps to perform some initialization and then corresponding de-initialization in the opposite order. Other use cases may emerge over time.
It is also worth noting that Mindcode doesn't have a decreasing range iteration loop. While this functionality can be easily encoded using other types of loops, it might make sense to support reversed iteration for range iteration loops as well.
What is now needed is to find a good syntax. Some possibilities include:
for a in reversed value1, value2, value3 do <loop body> end;
for a in value1, value2, value3 backwards do <loop body> end;
for i in reversed start ... stop do <loop body> end;
for i in start ... stop backwards do <loop body> end;: here descending would be better, but it doesn't fit well with the list iteration loop.
The text was updated successfully, but these errors were encountered:
In release 2.5.0, vararg functions were added. The argument list passed to a function can only be accessed through list iteration loops (for now), which only supports accessing the elements in their given order.
It might be useful to be able to also iterate through the values in a reversed order, perhaps to perform some initialization and then corresponding de-initialization in the opposite order. Other use cases may emerge over time.
It is also worth noting that Mindcode doesn't have a decreasing range iteration loop. While this functionality can be easily encoded using other types of loops, it might make sense to support reversed iteration for range iteration loops as well.
What is now needed is to find a good syntax. Some possibilities include:
for a in reversed value1, value2, value3 do <loop body> end;
for a in value1, value2, value3 backwards do <loop body> end;
for i in reversed start ... stop do <loop body> end;
for i in start ... stop backwards do <loop body> end;
: heredescending
would be better, but it doesn't fit well with the list iteration loop.The text was updated successfully, but these errors were encountered: