Hack on the docs a bit.

This commit is contained in:
Bob Nystrom
2014-01-30 06:51:52 -08:00
parent a5e65faf0d
commit f2aeb30b31
10 changed files with 32 additions and 15 deletions
+4 -3
View File
@@ -28,9 +28,10 @@ To make our unicorn do stuff, we need to give it methods.
This defines a `prance` method that takes no arguments. To support parameters, add a parenthesized parameter list after the method's name:
:::dart
// Inside class...
prance(where, when) {
IO.print("The unicorn prances in " + where + " at " + when)
class Unicorn {
prance(where, when) {
IO.print("The unicorn prances in " + where + " at " + when)
}
}
Unlike most other dynamically-typed languages, in Wren you can have multiple methods in a class with the same name, as long as they take a different number of parameters. In other words, you can overload by arity. So this class is fine:
+3
View File
@@ -0,0 +1,3 @@
^title Fibers
**TODO**
+3
View File
@@ -0,0 +1,3 @@
^title Functions
**TODO**
+3
View File
@@ -0,0 +1,3 @@
^title Lists
**TODO**
+3
View File
@@ -0,0 +1,3 @@
^title Maps
**TODO**
+1 -1
View File
@@ -83,7 +83,7 @@ it `b`".
Most of these are probably familiar already. The `..` and `...` operators are
"range" operators. The number type implements those and returns a range object,
which can in turn be iterated over using a [`for`](loops.html) loop.
which can in turn be iterated over using a `for` [loop](looping.html).
## Subscript operators
+3 -3
View File
@@ -35,9 +35,9 @@
<li><a href="values.html">Values</a></li>
<li><a href="classes.html">Classes</a></li>
<li><a href="functions.html">Functions</a></li>
<li>Fibers</li>
<li>Lists</li>
<li>Maps</li>
<li><a href="fibers.html">Fibers</a></li>
<li><a href="lists.html">Lists</a></li>
<li><a href="maps.html">Maps</a></li>
</ul>
<h2>Usage</h2>
<ul>
-3
View File
@@ -3,9 +3,6 @@
Values are the built-in object types that all other objects are composed of.
They can be created through *literals*, expressions that evaluate to a value.
All value types in Wren are immutable. That means that once created, they
cannot be changed. `3` is always three and `"hi"` is always `"hi"`.
## Booleans
A boolean value represents truth or falsehood. There are two boolean literals,