newLISP Fan Club

Forum => newLISP newS => Topic started by: Jeremy Dunn on July 29, 2008, 05:59:26 PM

Title: $idx
Post by: Jeremy Dunn on July 29, 2008, 05:59:26 PM
Now that $idx has been added to all looping structures could it be useful to also have two more? I wanted to suggest having two more locals named $prev and $next that would be defined as



$prev = $idx - 1

$next = $idx + 1



Often in loops it is the previous or next element that I am interested in also, this would provide a convenient way to get to them rather incrementing or decrementing explicitly.