Reorganize the language guide.

- Rename "Expressions" -> "Method Calls".
- Organize "Types" and "Language" into a single linear narrative.
- Mobile-specific navigation to handle the longer guide.
- Rename "Fibers" -> "Concurrency".
- Get rid of duplicate stuff about signatures in "Classes".
- Add next/prev links to each page in the guide.
- Move "Contributing" and "Community" up to the top level.
- Move the precendence table to a separate "Grammar" page.
- Lots of other little stuff.
This commit is contained in:
Bob Nystrom
2015-11-07 11:09:04 -08:00
parent bbd6b827b5
commit 931d9ca4d3
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>