File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ If your model already uses other extensions, then it already has an
1212` extensions ` line in it, so just add ` array ` to the list.
1313
1414For more information on using NetLogo extensions,
15- see the [ Extensions Guide] ( http ://ccl.northwestern.edu/ netlogo/docs /extensions.html)
15+ see the [ Extensions Guide] ( https ://docs. netlogo.org /extensions.html)
1616
1717### When to Use
1818
Original file line number Diff line number Diff line change 1+ extensionName : array
2+ icon : i-material-symbols-data-array
3+ filesToIncludeInManual :
4+ - USING.md
5+ - primitives
6+ markdownTemplate : |2
7+
8+ # NetLogo Array Extension
9+
10+ {{> BUILDING.md}}
11+
12+ {{> USING.md}}
13+
14+ ## Primitives
15+
16+ {{#contents}}{{#prims}}
17+ [`{{name}}`](#{{primitive.extensionName}}{{primitive.name}})
18+ {{/prims}}{{/contents}}
19+
20+ {{#primitives}}
21+ {{> primTemplate}}
22+ {{/primitives}}
23+
24+ {{> LICENSE.md}}
25+ primTemplate : |2
26+
27+ ### `{{name}}`
28+
29+ {{{description}}}
30+ primitives :
31+ - arguments :
32+ - type : list
33+ description : Reports a new array containing the same items in the same order as the input list.
34+ name : from-list
35+ returns : array
36+ type : reporter
37+ - arguments :
38+ - type : array
39+ - name : index
40+ type : number
41+ description : Reports the item in the given array with the given index (ranging from zero to the length of the array minus one).
42+ name : item
43+ returns : anything
44+ type : reporter
45+ - arguments :
46+ - type : array
47+ - name : index
48+ type : number
49+ - name : value
50+ type : anything
51+ description : |2
52+
53+ Sets the item in the given array with the given index (ranging from zero to the length of the array minus one) to the given value.
54+
55+ Note that unlike the `replace-item` primitive for lists, a new array is not created.
56+ The given array is actually modified.
57+ name : set
58+ type : command
59+ - arguments :
60+ - type : array
61+ description : Reports the length of the given array, that is, the number of items in the array.
62+ name : length
63+ returns : number
64+ type : reporter
65+ - arguments :
66+ - type : array
67+ description : Reports a new list containing the same items in the same order as the given array.
68+ name : to-list
69+ returns : list
70+ type : reporter
You can’t perform that action at this time.
0 commit comments