docs: reorganize language guide into linear narrative with renamed sections and navigation links
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
^title Lists
|
||||
^category types
|
||||
^category guide
|
||||
|
||||
A list is a compound object that holds a collection of elements identified by
|
||||
integer index. You can create a list by placing a sequence of comma-separated
|
||||
@@ -14,9 +14,11 @@ have to be the same type.
|
||||
## Accessing elements
|
||||
|
||||
You can access an element from a list by calling the [subscript
|
||||
operator](expressions.html#subscript-operators) on it with the index of the
|
||||
operator][] on it with the index of the
|
||||
element you want. Like most languages, indexes start at zero:
|
||||
|
||||
[subscript operator]: method-calls.html#subscripts
|
||||
|
||||
:::wren
|
||||
var hirsute = ["sideburns", "porkchops", "'stache", "goatee"]
|
||||
hirsute[0] //> sideburns
|
||||
@@ -109,3 +111,6 @@ If you want to remove everything from the list, you can clear it:
|
||||
:::wren
|
||||
hirsute.clear()
|
||||
System.print(hirsute) //> []
|
||||
|
||||
<a class="right" href="maps.html">Maps →</a>
|
||||
<a href="values.html">← Values</a>
|
||||
|
||||
Reference in New Issue
Block a user