I agree with Seth. How about the following instead?

to-report item-from-end [number list-or-string]
  report item (length list-or-string - number)  list-or-string
end

-ken


On 24 August 2014 19:00, Seth Tisue <[email protected]> wrote:

> >>>>> "Alan" == Alan Isaac <[email protected]> writes:
>
>  Alan> Today I was once again wishing for negative list indexes (e.g.,
>  Alan> -1 for the last item) for lists.  Has this been considered as a
>  Alan> possible NetLogo feature?
>
> I hope not.  I consider this a serious design blunder in the languages
> that offer it.  It's very easy to do compute an incorrect index by
> accident, and if you do, you really want your program to blow up
> immediately, not access the wrong element and keep chugging.
>
> --
> Seth Tisue | Northwestern University | http://tisue.net
> developer, NetLogo: http://ccl.northwestern.edu/netlogo/
>
> --
> You received this message because you are subscribed to the Google Groups
> "netlogo-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"netlogo-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to