1
0
forked from Mirror/wren

reorder some docs a bit, fix missing constructor

This commit is contained in:
ruby0x1
2021-04-07 21:21:50 -07:00
parent d38c047a5a
commit 0ab930c9c2
3 changed files with 5 additions and 8 deletions

View File

@ -33,7 +33,7 @@ list surrounded by `|` immediately after the opening brace of the body.
To pass arguments to the function, pass them to the `call` method:
<pre class="snippet">
var sayMessage {|recipient, message|
var sayMessage = Fn.new {|recipient, message|
System.print("message for %(recipient): %(message)")
}
@ -150,9 +150,6 @@ numbers.map {|n| n * 2 }.where {|n| n < 100 }
Let's look at a complete example, so we can see both ends.
This may be a bit of a spoiler for [classes](classes.html), so feel free
to read that page first and come back.
Here's a fictional class for something that will call a function
when a click event is sent to it. It allows us to pass just a
function and assume the left mouse button, or to pass a button and a function.

View File

@ -41,8 +41,8 @@
<li><a href="method-calls.html">Method Calls</a></li>
<li><a href="control-flow.html">Control Flow</a></li>
<li><a href="variables.html">Variables</a></li>
<li><a href="functions.html">Functions</a></li>
<li><a href="classes.html">Classes</a></li>
<li><a href="functions.html">Functions</a></li>
<li><a href="concurrency.html">Concurrency</a></li>
<li><a href="error-handling.html">Error Handling</a></li>
<li><a href="modularity.html">Modularity</a></li>
@ -90,8 +90,8 @@
<td>
<ul>
<li><a href="variables.html">Variables</a></li>
<li><a href="functions.html">Functions</a></li>
<li><a href="classes.html">Classes</a></li>
<li><a href="functions.html">Functions</a></li>
<li><a href="concurrency.html">Concurrency</a></li>
<li><a href="error-handling.html">Error Handling</a></li>
<li><a href="modularity.html">Modularity</a></li>

View File

@ -42,8 +42,8 @@
<li><a href="../method-calls.html">Method Calls</a></li>
<li><a href="../control-flow.html">Control Flow</a></li>
<li><a href="../variables.html">Variables</a></li>
<li><a href="../functions.html">Functions</a></li>
<li><a href="../classes.html">Classes</a></li>
<li><a href="../functions.html">Functions</a></li>
<li><a href="../concurrency.html">Concurrency</a></li>
<li><a href="../error-handling.html">Error Handling</a></li>
<li><a href="../modularity.html">Modularity</a></li>
@ -91,8 +91,8 @@
<td>
<ul>
<li><a href="../variables.html">Variables</a></li>
<li><a href="../functions.html">Functions</a></li>
<li><a href="../classes.html">Classes</a></li>
<li><a href="../functions.html">Functions</a></li>
<li><a href="../concurrency.html">Concurrency</a></li>
<li><a href="../error-handling.html">Error Handling</a></li>
<li><a href="../modularity.html">Modularity</a></li>