docs: reorganize language guide into linear narrative with renamed sections and navigation links

This commit is contained in:
Bob Nystrom
2015-11-07 19:09:04 +00:00
parent 7fcd513b23
commit efcc4d07c7
25 changed files with 751 additions and 615 deletions
+7 -2
View File
@@ -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 &rarr;</a>
<a href="values.html">&larr; Values</a>