docs: add watchdocs target, stub pages for fibers/lists/maps, fix class example, and move build output to build/docs
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
^title Fibers
|
||||
|
||||
**TODO**
|
||||
@@ -0,0 +1,3 @@
|
||||
^title Functions
|
||||
|
||||
**TODO**
|
||||
@@ -0,0 +1,3 @@
|
||||
^title Lists
|
||||
|
||||
**TODO**
|
||||
@@ -0,0 +1,3 @@
|
||||
^title Maps
|
||||
|
||||
**TODO**
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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,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,
|
||||
|
||||
Reference in New Issue
Block a user