NetLogo/Array-Extension — pull request #1 by colinsheppard (2012-08-22 19:28:26+00:00)
Title: Adding primitives to Array-Extension

Hi there, it would be very useful for me to have the ability to add/insert elements to a LogoArray. I've updated the extension code to include two new primitives:

add --- a wrapper for ArrayList.add(element)

insert -- a wrapper for ArrayList.add(index,element)

The following are draft additions for the documentation to reflect the new capabilities:

array:add
array:add array value

Adds the given value to the end of the given array. The value will take on the index equal to the previous length of the array. The length of the array will increase by one.

array:insert
array:insert array index value

Inserts the given value into the given array at the given index (ranging from zero to the length of the array minus one). Shifts the element currently at that position (if any) and any subsequent elements to the right (adds one to their indices). The length of the array will increase by one.