mirror of
https://github.com/wren-lang/wren.git
synced 2026-01-11 22:28:45 +01:00
Regenerate.
This commit is contained in:
88
classes.html
88
classes.html
@ -91,11 +91,11 @@ add a parenthesized parameter list after the method's name:</p>
|
||||
</pre></div>
|
||||
|
||||
|
||||
<h3>Arity <a href="#arity" name="arity" class="header-anchor">#</a></h3>
|
||||
<h3>Signature <a href="#signature" name="signature" class="header-anchor">#</a></h3>
|
||||
<p>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 technical terms, you can <em>overload by arity</em>. So this class
|
||||
is fine:</p>
|
||||
methods in a class with the same name, as long as they have a different
|
||||
parameter <em>signature</em>. In technical terms, you can <em>overload by arity</em>. So this
|
||||
class is fine:</p>
|
||||
<div class="codehilite"><pre><span class="kd">class</span> <span class="nc">Unicorn</span> <span class="p">{</span>
|
||||
<span class="n">prance</span> <span class="p">{</span>
|
||||
<span class="n">IO</span><span class="p">.</span><span class="n">print</span><span class="p">(</span><span class="s2">"The unicorn prances in a fancy manner!"</span><span class="p">)</span>
|
||||
@ -126,6 +126,43 @@ chosen.</p>
|
||||
sets of arguments. In other languages, you'd define a single method for the
|
||||
operation and have to check for "undefined" or missing arguments. Wren just
|
||||
treats them as different methods that you can implement separately.</p>
|
||||
<p>Signature is a bit more than just arity. It also lets you distinguish between a
|
||||
method that takes an <em>empty</em> argument list (<code>()</code>) and no argument list at all:</p>
|
||||
<div class="codehilite"><pre><span class="kd">class</span> <span class="nc">Confusing</span> <span class="p">{</span>
|
||||
<span class="n">method</span> <span class="p">{</span> <span class="s2">"no argument list"</span> <span class="p">}</span>
|
||||
<span class="n">method</span><span class="p">()</span> <span class="p">{</span> <span class="s2">"empty argument list"</span> <span class="p">}</span>
|
||||
<span class="p">}</span>
|
||||
|
||||
<span class="kd">var</span> <span class="n">confusing</span> <span class="o">=</span> <span class="k">new</span> <span class="n">Confusing</span>
|
||||
<span class="n">confusing</span><span class="p">.</span><span class="n">method</span> <span class="c1">// "no argument list".</span>
|
||||
<span class="n">confusing</span><span class="p">.</span><span class="n">method</span><span class="p">()</span> <span class="c1">// "empty argument list".</span>
|
||||
</pre></div>
|
||||
|
||||
|
||||
<p>Like the example says, having two methods that differ just by an empty set of
|
||||
parentheses is pretty confusing. That's not what this is for. It's mainly so
|
||||
you can define methods that don't take any arguments but look "method-like".</p>
|
||||
<p>Methods that don't need arguments and don't modify the underlying object tend
|
||||
to omit the parentheses. These are "getters" and usually access a property of
|
||||
an object, or produce a new object from it:</p>
|
||||
<div class="codehilite"><pre><span class="s2">"string"</span><span class="p">.</span><span class="n">count</span>
|
||||
<span class="p">(</span><span class="m">1.</span><span class="p">.</span><span class="m">3</span><span class="p">).</span><span class="n">min</span>
|
||||
<span class="m">0.123</span><span class="p">.</span><span class="n">sin</span>
|
||||
</pre></div>
|
||||
|
||||
|
||||
<p>Other methods do change the object, and it's helpful to draw attention to that:</p>
|
||||
<div class="codehilite"><pre><span class="n">list</span><span class="p">.</span><span class="n">clear</span><span class="p">()</span>
|
||||
</pre></div>
|
||||
|
||||
|
||||
<p>Since the parentheses are part of the method's signature, the callsite and
|
||||
definition have to agree. These don't work:</p>
|
||||
<div class="codehilite"><pre><span class="s">"string"</span><span class="p">.</span><span class="n">count</span><span class="p">()</span>
|
||||
<span class="n">list</span><span class="p">.</span><span class="n">clear</span>
|
||||
</pre></div>
|
||||
|
||||
|
||||
<h3>Operators <a href="#operators" name="operators" class="header-anchor">#</a></h3>
|
||||
<p>Operators are just special syntax for a method call on the left hand operand
|
||||
(or only operand in the case of unary operators like <code>!</code> and <code>~</code>). In other
|
||||
@ -194,7 +231,7 @@ constructor by adding a parenthesized parameter list after <code>new</code>:</p>
|
||||
</pre></div>
|
||||
|
||||
|
||||
<p>Like other methods, you can overload constructors by <a href="#arity">arity</a>.</p>
|
||||
<p>Like other methods, you can overload constructors by <a href="#signature">arity</a>.</p>
|
||||
<h2>Fields <a href="#fields" name="fields" class="header-anchor">#</a></h2>
|
||||
<p>All state stored in instances is stored in <em>fields</em>. Each field has a named
|
||||
that starts with an underscore.</p>
|
||||
@ -251,7 +288,46 @@ to or even should define getters or setters for most of your object's fields.</p
|
||||
<p>A name that starts with <em>two</em> underscores is a <em>static</em> field. They work
|
||||
similar to <a href="#fields">fields</a> except the data is stored on the class itself, and
|
||||
not the instance. They can be used in <em>both</em> instance and static methods.</p>
|
||||
<p><strong>TODO: Example.</strong></p>
|
||||
<div class="codehilite"><pre><span class="kd">class</span> <span class="nc">Foo</span> <span class="p">{</span>
|
||||
<span class="c1">// Set the static field.</span>
|
||||
<span class="kd">static</span> <span class="kd">set</span><span class="p">(</span><span class="n">a</span><span class="p">)</span> <span class="p">{</span>
|
||||
<span class="n">__a</span> <span class="o">=</span> <span class="n">a</span>
|
||||
<span class="p">}</span>
|
||||
|
||||
<span class="n">setFromInstance</span><span class="p">(</span><span class="n">a</span><span class="p">)</span> <span class="p">{</span>
|
||||
<span class="n">__a</span> <span class="o">=</span> <span class="n">a</span>
|
||||
<span class="p">}</span>
|
||||
|
||||
<span class="c1">// Can use __a in both static methods...</span>
|
||||
<span class="kd">static</span> <span class="n">bar</span> <span class="p">{</span> <span class="n">__a</span> <span class="p">}</span>
|
||||
|
||||
<span class="c1">// ...and instance ones.</span>
|
||||
<span class="n">baz</span> <span class="p">{</span> <span class="n">__a</span> <span class="p">}</span>
|
||||
<span class="p">}</span>
|
||||
</pre></div>
|
||||
|
||||
|
||||
<p>Just like instance fields, static fields are initially <code>null</code>:</p>
|
||||
<div class="codehilite"><pre><span class="n">IO</span><span class="p">.</span><span class="n">print</span><span class="p">(</span><span class="n">Foo</span><span class="p">.</span><span class="n">bar</span><span class="p">)</span> <span class="c1">// null.</span>
|
||||
</pre></div>
|
||||
|
||||
|
||||
<p>They can be used from static methods:</p>
|
||||
<div class="codehilite"><pre><span class="n">Foo</span><span class="p">.</span><span class="kd">set</span><span class="p">(</span><span class="s2">"foo"</span><span class="p">)</span>
|
||||
<span class="n">IO</span><span class="p">.</span><span class="n">print</span><span class="p">(</span><span class="n">Foo</span><span class="p">.</span><span class="n">bar</span><span class="p">)</span> <span class="c1">// foo.</span>
|
||||
</pre></div>
|
||||
|
||||
|
||||
<p>And also instance methods. When you do so, there is still only one static field
|
||||
shared among all instances of the class:</p>
|
||||
<div class="codehilite"><pre><span class="kd">var</span> <span class="n">foo1</span> <span class="o">=</span> <span class="k">new</span> <span class="n">Foo</span>
|
||||
<span class="kd">var</span> <span class="n">foo2</span> <span class="o">=</span> <span class="k">new</span> <span class="n">Foo</span>
|
||||
|
||||
<span class="n">foo1</span><span class="p">.</span><span class="n">setFromInstance</span><span class="p">(</span><span class="s2">"updated"</span><span class="p">)</span>
|
||||
<span class="n">IO</span><span class="p">.</span><span class="n">print</span><span class="p">(</span><span class="n">foo2</span><span class="p">.</span><span class="n">baz</span><span class="p">)</span> <span class="c1">// updated.</span>
|
||||
</pre></div>
|
||||
|
||||
|
||||
<h2>Inheritance <a href="#inheritance" name="inheritance" class="header-anchor">#</a></h2>
|
||||
<p>A class can inherit from a "parent" or <em>superclass</em>. When you invoke a method
|
||||
on an object of some class, if it can't be found, it walks up the chain of
|
||||
|
||||
@ -53,40 +53,42 @@ fiber is run. Does not immediately start running the fiber.</p>
|
||||
</pre></div>
|
||||
|
||||
|
||||
<h3>Fiber.<strong>yield</strong> <a href="#fiberyield" name="fiberyield" class="header-anchor">#</a></h3>
|
||||
<h3>Fiber.<strong>current</strong> <a href="#fibercurrent" name="fibercurrent" class="header-anchor">#</a></h3>
|
||||
<p>The currently executing fiber.</p>
|
||||
<h3>Fiber.<strong>yield</strong>() <a href="#fiberyield()" name="fiberyield()" class="header-anchor">#</a></h3>
|
||||
<p>Pauses the current fiber and transfers control to the parent fiber. "Parent"
|
||||
here means the last fiber that was started using <code>call</code> and not <code>run</code>.</p>
|
||||
<div class="codehilite"><pre><span class="kd">var</span> <span class="n">fiber</span> <span class="o">=</span> <span class="k">new</span> <span class="n">Fiber</span> <span class="p">{</span>
|
||||
<span class="n">IO</span><span class="p">.</span><span class="n">print</span><span class="p">(</span><span class="s2">"Before yield"</span><span class="p">)</span>
|
||||
<span class="n">Fiber</span><span class="p">.</span><span class="n">yield</span>
|
||||
<span class="n">Fiber</span><span class="p">.</span><span class="n">yield</span><span class="p">()</span>
|
||||
<span class="n">IO</span><span class="p">.</span><span class="n">print</span><span class="p">(</span><span class="s2">"After yield"</span><span class="p">)</span>
|
||||
<span class="p">}</span>
|
||||
|
||||
<span class="n">fiber</span><span class="p">.</span><span class="n">call</span> <span class="c1">// "Before yield"</span>
|
||||
<span class="n">fiber</span><span class="p">.</span><span class="n">call</span><span class="p">()</span> <span class="c1">// "Before yield"</span>
|
||||
<span class="n">IO</span><span class="p">.</span><span class="n">print</span><span class="p">(</span><span class="s2">"After call"</span><span class="p">)</span> <span class="c1">// "After call"</span>
|
||||
<span class="n">fiber</span><span class="p">.</span><span class="n">call</span> <span class="c1">// "After yield"</span>
|
||||
<span class="n">fiber</span><span class="p">.</span><span class="n">call</span><span class="p">()</span> <span class="c1">// "After yield"</span>
|
||||
</pre></div>
|
||||
|
||||
|
||||
<p>When resumed, the parent fiber's <code>call</code> method returns <code>null</code>.</p>
|
||||
<p>When resumed, the parent fiber's <code>call()</code> method returns <code>null</code>.</p>
|
||||
<p>If a yielded fiber is resumed by calling <code>call()</code> or <code>run()</code> with an argument,
|
||||
<code>yield</code> returns that value.</p>
|
||||
<code>yield()</code> returns that value.</p>
|
||||
<div class="codehilite"><pre><span class="kd">var</span> <span class="n">fiber</span> <span class="o">=</span> <span class="k">new</span> <span class="n">Fiber</span> <span class="p">{</span>
|
||||
<span class="n">IO</span><span class="p">.</span><span class="n">print</span><span class="p">(</span><span class="n">Fiber</span><span class="p">.</span><span class="n">yield</span><span class="p">)</span> <span class="c1">// "value"</span>
|
||||
<span class="n">IO</span><span class="p">.</span><span class="n">print</span><span class="p">(</span><span class="n">Fiber</span><span class="p">.</span><span class="n">yield</span><span class="p">())</span> <span class="c1">// "value"</span>
|
||||
<span class="p">}</span>
|
||||
|
||||
<span class="n">fiber</span><span class="p">.</span><span class="n">call</span> <span class="c1">// Run until the first yield.</span>
|
||||
<span class="n">fiber</span><span class="p">.</span><span class="n">call</span><span class="p">()</span> <span class="c1">// Run until the first yield.</span>
|
||||
<span class="n">fiber</span><span class="p">.</span><span class="n">call</span><span class="p">(</span><span class="s2">"value"</span><span class="p">)</span> <span class="c1">// Resume the fiber.</span>
|
||||
</pre></div>
|
||||
|
||||
|
||||
<p>If it was resumed by calling <code>call</code> or <code>run</code> with no argument, returns <code>null</code>.</p>
|
||||
<p>It is a runtime error to call this when there is no parent fiber to return to.</p>
|
||||
<div class="codehilite"><pre><span class="n">Fiber</span><span class="p">.</span><span class="n">yield</span> <span class="c1">// ERROR</span>
|
||||
|
||||
<span class="k">new</span> <span class="n">Fiber</span> <span class="p">{</span>
|
||||
<span class="n">Fiber</span><span class="p">.</span><span class="n">yield</span> <span class="c1">// ERROR</span>
|
||||
<span class="p">}.</span><span class="n">run</span>
|
||||
<p>If it was resumed by calling <code>call()</code> or <code>run()</code> with no argument, it returns
|
||||
<code>null</code>.</p>
|
||||
<p>If there is no parent fiber to return to, this exits the interpreter. This can
|
||||
be useful to pause execution until the host application wants to resume it
|
||||
later.</p>
|
||||
<div class="codehilite"><pre><span class="n">Fiber</span><span class="p">.</span><span class="n">yield</span><span class="p">()</span>
|
||||
<span class="n">IO</span><span class="p">.</span><span class="n">print</span><span class="p">(</span><span class="s2">"this does not get reached"</span><span class="p">)</span>
|
||||
</pre></div>
|
||||
|
||||
|
||||
@ -97,18 +99,18 @@ here means the last fiber that was started using <code>call</code> and not <code
|
||||
<span class="n">Fiber</span><span class="p">.</span><span class="n">yield</span><span class="p">(</span><span class="s2">"value"</span><span class="p">)</span>
|
||||
<span class="p">}</span>
|
||||
|
||||
<span class="n">IO</span><span class="p">.</span><span class="n">print</span><span class="p">(</span><span class="n">fiber</span><span class="p">.</span><span class="n">call</span><span class="p">)</span> <span class="c1">// "value"</span>
|
||||
<span class="n">IO</span><span class="p">.</span><span class="n">print</span><span class="p">(</span><span class="n">fiber</span><span class="p">.</span><span class="n">call</span><span class="p">())</span> <span class="c1">// "value"</span>
|
||||
</pre></div>
|
||||
|
||||
|
||||
<h3><strong>call</strong> <a href="#call" name="call" class="header-anchor">#</a></h3>
|
||||
<h3><strong>call</strong>() <a href="#call()" name="call()" class="header-anchor">#</a></h3>
|
||||
<p><strong>TODO</strong></p>
|
||||
<h3><strong>call</strong>(value) <a href="#call(value)" name="call(value)" class="header-anchor">#</a></h3>
|
||||
<p><strong>TODO</strong></p>
|
||||
<h3><strong>isDone</strong> <a href="#isdone" name="isdone" class="header-anchor">#</a></h3>
|
||||
<p>Whether the fiber's main function has completed and the fiber can no longer be
|
||||
run. This returns <code>false</code> if the fiber is currently running or has yielded.</p>
|
||||
<h3><strong>run</strong> <a href="#run" name="run" class="header-anchor">#</a></h3>
|
||||
<h3><strong>run</strong>() <a href="#run()" name="run()" class="header-anchor">#</a></h3>
|
||||
<p><strong>TODO</strong></p>
|
||||
<h3><strong>run</strong>(value) <a href="#run(value)" name="run(value)" class="header-anchor">#</a></h3>
|
||||
<p><strong>TODO</strong></p>
|
||||
|
||||
10
core/fn.html
10
core/fn.html
@ -46,17 +46,17 @@
|
||||
<p>A first class function—an object that wraps an executable chunk of code.
|
||||
<a href="../functions.html">Here</a> is a friendly introduction.</p>
|
||||
<h3>new <strong>Fn</strong>(function) <a href="#new-fn(function)" name="new-fn(function)" class="header-anchor">#</a></h3>
|
||||
<p>Creates a new function from... <code>function</code>. Of course, <code>function</code> is already be
|
||||
a function, so this really just returns the argument. It exists mainly to let
|
||||
you create a "bare" function when you don't want to immediately pass it as a
|
||||
<a href="../functions.html#block-arguments">block argument</a> to some other method.</p>
|
||||
<p>Creates a new function from... <code>function</code>. Of course, <code>function</code> is already a
|
||||
function, so this really just returns the argument. It exists mainly to let you
|
||||
create a "bare" function when you don't want to immediately pass it as a <a href="../functions.html#block-arguments">block
|
||||
argument</a> to some other method.</p>
|
||||
<div class="codehilite"><pre><span class="kd">var</span> <span class="n">fn</span> <span class="o">=</span> <span class="k">new</span> <span class="n">Fn</span> <span class="p">{</span>
|
||||
<span class="n">IO</span><span class="p">.</span><span class="n">print</span><span class="p">(</span><span class="s2">"The body"</span><span class="p">)</span>
|
||||
<span class="p">}</span>
|
||||
</pre></div>
|
||||
|
||||
|
||||
<p>It is a runtime error if <code>block</code> is not a function.</p>
|
||||
<p>It is a runtime error if <code>function</code> is not a function.</p>
|
||||
<h3><strong>arity</strong> <a href="#arity" name="arity" class="header-anchor">#</a></h3>
|
||||
<p>The number of arguments the function requires.</p>
|
||||
<div class="codehilite"><pre><span class="n">IO</span><span class="p">.</span><span class="n">print</span><span class="p">(</span><span class="k">new</span> <span class="n">Fn</span> <span class="p">{}.</span><span class="n">arity</span><span class="p">)</span> <span class="c1">// 0.</span>
|
||||
|
||||
@ -47,7 +47,7 @@
|
||||
<p>An indexable contiguous collection of elements. More details <a href="../lists.html">here</a>.</p>
|
||||
<h3><strong>add</strong>(item) <a href="#add(item)" name="add(item)" class="header-anchor">#</a></h3>
|
||||
<p>Appends <code>item</code> to the end of the list.</p>
|
||||
<h3><strong>clear</strong> <a href="#clear" name="clear" class="header-anchor">#</a></h3>
|
||||
<h3><strong>clear</strong>() <a href="#clear()" name="clear()" class="header-anchor">#</a></h3>
|
||||
<p>Removes all items from the list.</p>
|
||||
<h3><strong>count</strong> <a href="#count" name="count" class="header-anchor">#</a></h3>
|
||||
<p>The number of items in the list.</p>
|
||||
@ -67,7 +67,7 @@ are shifted up to fill in where the removed element was.</p>
|
||||
|
||||
|
||||
<p>Returns the removed item.</p>
|
||||
<div class="codehilite"><pre><span class="n">IO</span><span class="p">.</span><span class="n">print</span><span class="p">([</span><span class="s">"a"</span><span class="p">,</span> <span class="s">"b"</span><span class="p">,</span> <span class="s">"c"</span><span class="p">].</span><span class="n">removeAt</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span> <span class="c1">// "b".</span>
|
||||
<div class="codehilite"><pre><span class="n">IO</span><span class="p">.</span><span class="n">print</span><span class="p">([</span><span class="s">"a"</span><span class="p">,</span> <span class="s">"b"</span><span class="p">,</span> <span class="s">"c"</span><span class="p">].</span><span class="n">removeAt</span><span class="p">(</span><span class="mi">1</span><span class="p">))</span> <span class="c1">// "b".</span>
|
||||
</pre></div>
|
||||
|
||||
|
||||
|
||||
@ -44,7 +44,7 @@
|
||||
<main>
|
||||
<h1>Map Class</h1>
|
||||
<p>An associative collection that maps keys to values. More details <a href="../maps.html">here</a>.</p>
|
||||
<h3><strong>clear</strong> <a href="#clear" name="clear" class="header-anchor">#</a></h3>
|
||||
<h3><strong>clear</strong>() <a href="#clear()" name="clear()" class="header-anchor">#</a></h3>
|
||||
<p>Removes all entries from the map.</p>
|
||||
<h3><strong>containsKey</strong>(key) <a href="#containskey(key)" name="containskey(key)" class="header-anchor">#</a></h3>
|
||||
<p>Returns <code>true</code> if the map contains <code>key</code> or <code>false</code> otherwise.</p>
|
||||
|
||||
@ -43,19 +43,28 @@
|
||||
</nav>
|
||||
<main>
|
||||
<h1>Num Class</h1>
|
||||
<p><strong>TODO</strong></p>
|
||||
<h3><strong>abs</strong> <a href="#abs" name="abs" class="header-anchor">#</a></h3>
|
||||
<h3><strong>abs</strong> <a href="#abs" name="abs" class="header-anchor">#</a></h3>
|
||||
<p>The absolute value of the number.</p>
|
||||
<div class="codehilite"><pre><span class="o">-</span><span class="m">123.</span><span class="n">abs</span> <span class="c1">// 123</span>
|
||||
</pre></div>
|
||||
|
||||
|
||||
<h3><strong>ceil</strong> <a href="#ceil" name="ceil" class="header-anchor">#</a></h3>
|
||||
<p><strong>TODO</strong></p>
|
||||
<p>Rounds the number up to the nearest integer.</p>
|
||||
<div class="codehilite"><pre><span class="m">1.5</span><span class="p">.</span><span class="n">ceil</span> <span class="c1">// 2</span>
|
||||
<span class="p">(</span><span class="o">-</span><span class="m">3.2</span><span class="p">).</span><span class="n">ceil</span> <span class="c1">// -3</span>
|
||||
</pre></div>
|
||||
|
||||
|
||||
<h3><strong>cos</strong> <a href="#cos" name="cos" class="header-anchor">#</a></h3>
|
||||
<p>The cosine of the number.</p>
|
||||
<h3><strong>floor</strong> <a href="#floor" name="floor" class="header-anchor">#</a></h3>
|
||||
<p><strong>TODO</strong></p>
|
||||
<p>Rounds the number down to the nearest integer.</p>
|
||||
<div class="codehilite"><pre><span class="m">1.5</span><span class="p">.</span><span class="n">floor</span> <span class="c1">// 1</span>
|
||||
<span class="p">(</span><span class="o">-</span><span class="m">3.2</span><span class="p">).</span><span class="n">floor</span> <span class="c1">// -4</span>
|
||||
</pre></div>
|
||||
|
||||
|
||||
<h3><strong>isNan</strong> <a href="#isnan" name="isnan" class="header-anchor">#</a></h3>
|
||||
<p>Whether the number is <a href="http://en.wikipedia.org/wiki/NaN">not a number</a>. This is
|
||||
<code>false</code> for normal number values and infinities, and <code>true</code> for the result of
|
||||
@ -96,9 +105,29 @@ unsigned values. The result is then a 32-bit unsigned number where each bit is
|
||||
<code>true</code> only where the corresponding bits of both inputs were <code>true</code>.</p>
|
||||
<p>It is a runtime error if <code>other</code> is not a number.</p>
|
||||
<h3><strong>..</strong>(other) operator <a href="#(other)-operator" name="(other)-operator" class="header-anchor">#</a></h3>
|
||||
<p><strong>TODO</strong></p>
|
||||
<p>Creates a <a href="core/range.html">Range</a> representing a consecutive range of numbers
|
||||
from the beginning number to the ending number.</p>
|
||||
<div class="codehilite"><pre><span class="kd">var</span> <span class="n">range</span> <span class="o">=</span> <span class="m">1.2</span><span class="p">..</span><span class="m">3.4</span>
|
||||
<span class="n">IO</span><span class="p">.</span><span class="n">print</span><span class="p">(</span><span class="n">range</span><span class="p">.</span><span class="n">min</span><span class="p">)</span> <span class="c1">// 1.2</span>
|
||||
<span class="n">IO</span><span class="p">.</span><span class="n">print</span><span class="p">(</span><span class="n">range</span><span class="p">.</span><span class="n">max</span><span class="p">)</span> <span class="c1">// 3.4</span>
|
||||
<span class="n">IO</span><span class="p">.</span><span class="n">print</span><span class="p">(</span><span class="n">range</span><span class="p">.</span><span class="n">isInclusive</span><span class="p">)</span> <span class="c1">// true</span>
|
||||
</pre></div>
|
||||
|
||||
|
||||
<h3><strong>...</strong>(other) operator <a href="#(other)-operator" name="(other)-operator" class="header-anchor">#</a></h3>
|
||||
<p><strong>TODO</strong></p>
|
||||
<p>Creates a <a href="core/range.html">Range</a> representing a consecutive range of numbers
|
||||
from the beginning number to the ending number not including the ending number.</p>
|
||||
<div class="codehilite"><pre><span class="kd">var</span> <span class="n">range</span> <span class="o">=</span> <span class="m">1.2</span><span class="p">...</span><span class="m">3.4</span>
|
||||
<span class="n">IO</span><span class="p">.</span><span class="n">print</span><span class="p">(</span><span class="n">range</span><span class="p">.</span><span class="n">min</span><span class="p">)</span> <span class="c1">// 1.2</span>
|
||||
<span class="n">IO</span><span class="p">.</span><span class="n">print</span><span class="p">(</span><span class="n">range</span><span class="p">.</span><span class="n">max</span><span class="p">)</span> <span class="c1">// 3.4</span>
|
||||
<span class="n">IO</span><span class="p">.</span><span class="n">print</span><span class="p">(</span><span class="n">range</span><span class="p">.</span><span class="n">isInclusive</span><span class="p">)</span> <span class="c1">// false</span>
|
||||
</pre></div>
|
||||
|
||||
|
||||
<h3>Num.<strong>fromString</strong>(value) <a href="#numfromstring(value)" name="numfromstring(value)" class="header-anchor">#</a></h3>
|
||||
<p>Attempts to parse <code>value</code> as a decimal literal and return it as an instance of
|
||||
<code>Num</code>. If the number cannot be parsed <code>null</code> will be returned.</p>
|
||||
<p>It is a runtime error if <code>value</code> is not a string.</p>
|
||||
</main>
|
||||
</div>
|
||||
<footer>
|
||||
|
||||
@ -48,13 +48,23 @@ core <a href="../control-flow.html#the-iterator-protocol">iterator protocol</a>
|
||||
<h3><strong>all</strong>(predicate) <a href="#all(predicate)" name="all(predicate)" class="header-anchor">#</a></h3>
|
||||
<p>Tests whether all the elements in the sequence pass the <code>predicate</code>.</p>
|
||||
<p>Iterates over the sequence, passing each element to the function <code>predicate</code>.
|
||||
If it returns <code>false</code>, stops iterating and returns <code>false</code>. Otherwise, returns
|
||||
<code>true</code>.</p>
|
||||
If its return value evaluates to <code>false</code>, stops iterating and returns <code>false</code>.
|
||||
Otherwise, returns <code>true</code>.</p>
|
||||
<div class="codehilite"><pre><span class="p">[</span><span class="m">1</span><span class="p">,</span> <span class="m">2</span><span class="p">,</span> <span class="m">3</span><span class="p">].</span><span class="n">all</span> <span class="p">{</span><span class="o">|</span><span class="n">n</span><span class="o">|</span> <span class="n">n</span> <span class="o">></span> <span class="m">2</span><span class="p">}</span> <span class="c1">// False.</span>
|
||||
<span class="p">[</span><span class="m">1</span><span class="p">,</span> <span class="m">2</span><span class="p">,</span> <span class="m">3</span><span class="p">].</span><span class="n">all</span> <span class="p">{</span><span class="o">|</span><span class="n">n</span><span class="o">|</span> <span class="n">n</span> <span class="o"><</span> <span class="m">4</span><span class="p">}</span> <span class="c1">// True.</span>
|
||||
</pre></div>
|
||||
|
||||
|
||||
<h3><strong>any</strong>(predicate) <a href="#any(predicate)" name="any(predicate)" class="header-anchor">#</a></h3>
|
||||
<p>Tests whether any element in the sequence passes the <code>predicate</code>.</p>
|
||||
<p>Iterates over the sequence, passing each element to the function <code>predicate</code>.
|
||||
If its return value evaluates to <code>true</code>, stops iterating and returns <code>true</code>.
|
||||
Otherwise, returns <code>false</code>.</p>
|
||||
<div class="codehilite"><pre><span class="p">[</span><span class="m">1</span><span class="p">,</span> <span class="m">2</span><span class="p">,</span> <span class="m">3</span><span class="p">].</span><span class="n">any</span> <span class="p">{</span><span class="o">|</span><span class="n">n</span><span class="o">|</span> <span class="n">n</span> <span class="o"><</span> <span class="m">1</span><span class="p">}</span> <span class="c1">// False.</span>
|
||||
<span class="p">[</span><span class="m">1</span><span class="p">,</span> <span class="m">2</span><span class="p">,</span> <span class="m">3</span><span class="p">].</span><span class="n">any</span> <span class="p">{</span><span class="o">|</span><span class="n">n</span><span class="o">|</span> <span class="n">n</span> <span class="o">></span> <span class="m">2</span><span class="p">}</span> <span class="c1">// True.</span>
|
||||
</pre></div>
|
||||
|
||||
|
||||
<h3><strong>join</strong>(sep) <a href="#join(sep)" name="join(sep)" class="header-anchor">#</a></h3>
|
||||
<p>Returns a string representation of the list. The string representations of the
|
||||
elements in the list is concatenated with intervening occurrences of <code>sep</code>.</p>
|
||||
|
||||
@ -150,7 +150,7 @@ error message as a string.</p>
|
||||
<span class="m">123.</span><span class="n">badMethod</span>
|
||||
<span class="p">}</span>
|
||||
|
||||
<span class="kd">var</span> <span class="n">error</span> <span class="o">=</span> <span class="n">fiber</span><span class="p">.</span><span class="k">try</span>
|
||||
<span class="kd">var</span> <span class="n">error</span> <span class="o">=</span> <span class="n">fiber</span><span class="p">.</span><span class="k">try</span><span class="p">()</span>
|
||||
<span class="n">IO</span><span class="p">.</span><span class="n">print</span><span class="p">(</span><span class="s2">"Caught error: "</span><span class="p">,</span> <span class="n">error</span><span class="p">)</span>
|
||||
</pre></div>
|
||||
|
||||
@ -195,8 +195,9 @@ only way the program could prevent that failure is by validating the string
|
||||
before its parsed, but validating that a string is a number is pretty much the
|
||||
same thing as parsing it.</p>
|
||||
<p>For cases like this where failure can occur and the program <em>will</em> want to
|
||||
handle it, fibers and <code>try</code> are too coarse-grained to work with. Instead, these
|
||||
operations will indicate failure by <em>returning</em> some sort of error indication.</p>
|
||||
handle it, fibers and <code>try()</code> are too coarse-grained to work with. Instead,
|
||||
these operations will indicate failure by <em>returning</em> some sort of error
|
||||
indication.</p>
|
||||
<p>For example, a method for parsing a number could return a number on success and
|
||||
<code>null</code> to indicate parsing failed. Since Wren is dynamically typed, it's easy
|
||||
and natural for a method to return different types of values.</p>
|
||||
|
||||
144
expressions.html
144
expressions.html
@ -85,13 +85,24 @@ look like so:</p>
|
||||
|
||||
<p>You have a <em>receiver</em> expression followed by a <code>.</code>, then a name and an argument
|
||||
list in parentheses. Arguments are separated by commas. Methods that do not
|
||||
take any arguments omit the <code>()</code>:</p>
|
||||
take any arguments can omit the <code>()</code>:</p>
|
||||
<div class="codehilite"><pre><span class="n">text</span><span class="p">.</span><span class="n">length</span>
|
||||
</pre></div>
|
||||
|
||||
|
||||
<p>These are special "getters" or "accessors" in other languages. In Wren, they're
|
||||
just method calls.</p>
|
||||
just method calls. You can also define methods that take an empty argument list:</p>
|
||||
<div class="codehilite"><pre><span class="n">list</span><span class="p">.</span><span class="n">clear</span><span class="p">()</span>
|
||||
</pre></div>
|
||||
|
||||
|
||||
<p>An empty argument list is <em>not</em> the same as omitting the parentheses
|
||||
completely. Wren lets you overload methods by their call signature. This mainly
|
||||
means <a href="classes.html#signature"><em>arity</em></a>—number of parameters—but
|
||||
also distinguishes between "empty parentheses" and "no parentheses at all".</p>
|
||||
<p>You can have a class that defines both <code>foo</code> and <code>foo()</code> as separate methods.
|
||||
Think of it like the parentheses and commas between arguments are part of the
|
||||
method's <em>name</em>.</p>
|
||||
<p>If the last (or only) argument to a method call is a
|
||||
<a href="functions.html">function</a>, it may be passed as a <a href="functions.html#block-arguments">block
|
||||
argument</a>:</p>
|
||||
@ -273,21 +284,122 @@ class (or one of its subclasses).</p>
|
||||
|
||||
<h2>Precedence <a href="#precedence" name="precedence" class="header-anchor">#</a></h2>
|
||||
<p>When you mix these all together, you need to worry about
|
||||
<em>precedence</em>—which operators bind more tightly than others. Wren mostly
|
||||
<em>precedence</em>—which operators bind more tightly than others—and
|
||||
<em>associativity</em>—how a series of the same operator is ordered. Wren mostly
|
||||
follows C, except that it fixes the bitwise operator mistake. The full
|
||||
precedence table, from lowest to highest, is:</p>
|
||||
<div class="codehilite"><pre><span class="o">=</span> <span class="c1">// Assignment.</span>
|
||||
<span class="o">&&</span> <span class="o">||</span> <span class="o">?:</span> <span class="c1">// Logic.</span>
|
||||
<span class="k">is</span> <span class="c1">// Type test.</span>
|
||||
<span class="o">==</span> <span class="o">!=</span> <span class="c1">// Equality.</span>
|
||||
<span class="o"><</span> <span class="o">></span> <span class="o"><=</span> <span class="o">>=</span> <span class="c1">// Comparison.</span>
|
||||
<span class="p">..</span> <span class="p">...</span> <span class="c1">// Range.</span>
|
||||
<span class="o">|</span> <span class="o">&</span> <span class="c1">// Bitwise.</span>
|
||||
<span class="o">+</span> <span class="o">-</span> <span class="c1">// Terms.</span>
|
||||
<span class="o">*</span> <span class="o">/</span> <span class="o">%</span> <span class="c1">// Factors.</span>
|
||||
<span class="o">-</span> <span class="o">~</span> <span class="o">!</span> <span class="c1">// Unary.</span>
|
||||
<span class="p">.</span> <span class="p">[]</span> <span class="c1">// Call.</span>
|
||||
</pre></div>
|
||||
precedence table, from highest to lowest, is:</p>
|
||||
<table class="precedence">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>Prec</th>
|
||||
<th>Operator</th>
|
||||
<th>Description</th>
|
||||
<th>Assoc</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>1</td>
|
||||
<td><code>()</code> <code>[]</code> <code>.</code></td>
|
||||
<td>Grouping, Subscript, Method call</td>
|
||||
<td>Left</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>2</td>
|
||||
<td><code>-</code> <code>!</code> <code>~</code></td>
|
||||
<td>Negate, Not, Complement</td>
|
||||
<td>Right</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>3</td>
|
||||
<td><code>*</code> <code>/</code> <code>%</code></td>
|
||||
<td>Multiply, Divide, Modulo</td>
|
||||
<td>Left</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>4</td>
|
||||
<td><code>+</code> <code>-</code></td>
|
||||
<td>Add, Subtract</td>
|
||||
<td>Left</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>5</td>
|
||||
<td><code>..</code> <code>...</code></td>
|
||||
<td>Inclusive range, Exclusive range</td>
|
||||
<td>Left</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>6</td>
|
||||
<td><code><<</code> <code>>></code></td>
|
||||
<td>Left shift, Right shift</td>
|
||||
<td>Left</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>7</td>
|
||||
<td><code><</code> <code><=</code> <code>></code> <code>>=</code></td>
|
||||
<td>Comparison</td>
|
||||
<td>Left</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>8</td>
|
||||
<td><code>==</code></td>
|
||||
<td>Equals</td>
|
||||
<td>Left</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>8</td>
|
||||
<td><code>!=</code></td>
|
||||
<td>Not equal</td>
|
||||
<td>Left</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>9</td>
|
||||
<td><code>&</code></td>
|
||||
<td>Bitwise and</td>
|
||||
<td>Left</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>10</td>
|
||||
<td><code>^</code></td>
|
||||
<td>Bitwise xor</td>
|
||||
<td>Left</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>11</td>
|
||||
<td><code>|</code></td>
|
||||
<td>Bitwise or</td>
|
||||
<td>Left</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>12</td>
|
||||
<td><code>is</code></td>
|
||||
<td>Type test</td>
|
||||
<td>Left</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>13</td>
|
||||
<td><code>&&</code></td>
|
||||
<td>Logical and</td>
|
||||
<td>Left</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>14</td>
|
||||
<td><code>||</code></td>
|
||||
<td>Logical or</td>
|
||||
<td>Left</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>15</td>
|
||||
<td><code>?:</code></td>
|
||||
<td>Conditional</td>
|
||||
<td>Right</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>16</td>
|
||||
<td><code>=</code></td>
|
||||
<td>Assign</td>
|
||||
<td>Right</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</main>
|
||||
</div>
|
||||
<footer>
|
||||
|
||||
36
fibers.html
36
fibers.html
@ -88,8 +88,8 @@ code sitting there waiting to be activated, a bit like a
|
||||
<a href="functions.html">function</a>.</p>
|
||||
<h2>Invoking fibers <a href="#invoking-fibers" name="invoking-fibers" class="header-anchor">#</a></h2>
|
||||
<p>Once you've created a fiber, you can invoke it (which suspends the current
|
||||
fiber) by calling its <code>call</code> method:</p>
|
||||
<div class="codehilite"><pre><span class="n">fiber</span><span class="p">.</span><span class="n">call</span>
|
||||
fiber) by calling its <code>call()</code> method:</p>
|
||||
<div class="codehilite"><pre><span class="n">fiber</span><span class="p">.</span><span class="n">call</span><span class="p">()</span>
|
||||
</pre></div>
|
||||
|
||||
|
||||
@ -98,7 +98,7 @@ until it passes control to another fiber. If it reaches the end of its body,
|
||||
it's considered <em>done</em>:</p>
|
||||
<div class="codehilite"><pre><span class="kd">var</span> <span class="n">fiber</span> <span class="o">=</span> <span class="k">new</span> <span class="n">Fiber</span> <span class="p">{</span> <span class="n">IO</span><span class="p">.</span><span class="n">print</span><span class="p">(</span><span class="s2">"Hi"</span><span class="p">)</span> <span class="p">}</span>
|
||||
<span class="n">fiber</span><span class="p">.</span><span class="n">isDone</span> <span class="c1">// false</span>
|
||||
<span class="n">fiber</span><span class="p">.</span><span class="n">call</span>
|
||||
<span class="n">fiber</span><span class="p">.</span><span class="n">call</span><span class="p">()</span>
|
||||
<span class="n">fiber</span><span class="p">.</span><span class="n">isDone</span> <span class="c1">// true</span>
|
||||
</pre></div>
|
||||
|
||||
@ -113,17 +113,17 @@ as one function calling another.</p>
|
||||
<p>Things get interesting when a fiber <em>yields</em>. A yielded fiber passes control
|
||||
<em>back</em> to the fiber that ran it, but <em>remembers where it is</em>. The next time the
|
||||
fiber is called, it picks up right where it left off and keeps going.</p>
|
||||
<p>You can make a fiber yield by calling the static <code>yield</code> method on <code>Fiber</code>:</p>
|
||||
<p>You can make a fiber yield by calling the static <code>yield()</code> method on <code>Fiber</code>:</p>
|
||||
<div class="codehilite"><pre><span class="kd">var</span> <span class="n">fiber</span> <span class="o">=</span> <span class="k">new</span> <span class="n">Fiber</span> <span class="p">{</span>
|
||||
<span class="n">IO</span><span class="p">.</span><span class="n">print</span><span class="p">(</span><span class="s2">"fiber 1"</span><span class="p">)</span>
|
||||
<span class="n">Fiber</span><span class="p">.</span><span class="n">yield</span>
|
||||
<span class="n">Fiber</span><span class="p">.</span><span class="n">yield</span><span class="p">()</span>
|
||||
<span class="n">IO</span><span class="p">.</span><span class="n">print</span><span class="p">(</span><span class="s2">"fiber 2"</span><span class="p">)</span>
|
||||
<span class="p">}</span>
|
||||
|
||||
<span class="n">IO</span><span class="p">.</span><span class="n">print</span><span class="p">(</span><span class="s2">"main 1"</span><span class="p">)</span>
|
||||
<span class="n">fiber</span><span class="p">.</span><span class="n">call</span>
|
||||
<span class="n">fiber</span><span class="p">.</span><span class="n">call</span><span class="p">()</span>
|
||||
<span class="n">IO</span><span class="p">.</span><span class="n">print</span><span class="p">(</span><span class="s2">"main 2"</span><span class="p">)</span>
|
||||
<span class="n">fiber</span><span class="p">.</span><span class="n">call</span>
|
||||
<span class="n">fiber</span><span class="p">.</span><span class="n">call</span><span class="p">()</span>
|
||||
<span class="n">IO</span><span class="p">.</span><span class="n">print</span><span class="p">(</span><span class="s2">"main 3"</span><span class="p">)</span>
|
||||
</pre></div>
|
||||
|
||||
@ -144,9 +144,9 @@ the mercy of a thread scheduler playing Russian roulette with your code.</p>
|
||||
<p>Calling and yielding fibers is used for passing control, but it can also pass
|
||||
<em>data</em>. When you call a fiber, you can optionally pass a value to it. If the
|
||||
fiber has yielded and is waiting to resume, the value becomes the return value
|
||||
of the <code>yield</code> call:</p>
|
||||
of the <code>yield()</code> call:</p>
|
||||
<div class="codehilite"><pre><span class="kd">var</span> <span class="n">fiber</span> <span class="o">=</span> <span class="k">new</span> <span class="n">Fiber</span> <span class="p">{</span>
|
||||
<span class="kd">var</span> <span class="n">result</span> <span class="o">=</span> <span class="n">Fiber</span><span class="p">.</span><span class="n">yield</span>
|
||||
<span class="kd">var</span> <span class="n">result</span> <span class="o">=</span> <span class="n">Fiber</span><span class="p">.</span><span class="n">yield</span><span class="p">()</span>
|
||||
<span class="n">IO</span><span class="p">.</span><span class="n">print</span><span class="p">(</span><span class="n">result</span><span class="p">)</span>
|
||||
<span class="p">}</span>
|
||||
|
||||
@ -156,16 +156,16 @@ of the <code>yield</code> call:</p>
|
||||
|
||||
|
||||
<p>This prints "sent". Note that the first value sent to the fiber through call is
|
||||
ignored. That's because the fiber isn't waiting on a <code>yield</code> call, so there's
|
||||
ignored. That's because the fiber isn't waiting on a <code>yield()</code> call, so there's
|
||||
no where for the sent value to go.</p>
|
||||
<p>Fibers can also pass values <em>back</em> when they yield. If you pass an argument to
|
||||
<code>yield</code>, that will become the return value of the <code>call</code> that was used to
|
||||
<code>yield()</code>, that will become the return value of the <code>call</code> that was used to
|
||||
invoke the fiber:</p>
|
||||
<div class="codehilite"><pre><span class="kd">var</span> <span class="n">fiber</span> <span class="o">=</span> <span class="k">new</span> <span class="n">Fiber</span> <span class="p">{</span>
|
||||
<span class="n">Fiber</span><span class="p">.</span><span class="n">yield</span><span class="p">(</span><span class="s2">"sent"</span><span class="p">)</span>
|
||||
<span class="p">}</span>
|
||||
|
||||
<span class="n">IO</span><span class="p">.</span><span class="n">print</span><span class="p">(</span><span class="n">fiber</span><span class="p">.</span><span class="n">call</span><span class="p">)</span>
|
||||
<span class="n">IO</span><span class="p">.</span><span class="n">print</span><span class="p">(</span><span class="n">fiber</span><span class="p">.</span><span class="n">call</span><span class="p">())</span>
|
||||
</pre></div>
|
||||
|
||||
|
||||
@ -186,13 +186,13 @@ example:</p>
|
||||
</pre></div>
|
||||
|
||||
|
||||
<p>Here, we're calling <code>yield</code> from within a <a href="functions.html">function</a> being
|
||||
passed to the <code>map</code> method. This works fine in Wren because that inner <code>yield</code>
|
||||
call will suspend the call to <code>map</code> and the function passed to it as a
|
||||
callback.</p>
|
||||
<p>Here, we're calling <code>yield()</code> from within a <a href="functions.html">function</a> being
|
||||
passed to the <code>map()</code> method. This works fine in Wren because that inner
|
||||
<code>yield()</code> call will suspend the call to <code>map()</code> and the function passed to it
|
||||
as a callback.</p>
|
||||
<h2>Transferring control <a href="#transferring-control" name="transferring-control" class="header-anchor">#</a></h2>
|
||||
<p>Fibers have one more trick up their sleeves. When you execute a fiber using
|
||||
<code>call</code>, the fiber tracks which fiber it will return to when it yields. This
|
||||
<code>call()</code>, the fiber tracks which fiber it will return to when it yields. This
|
||||
lets you build up a chain of fiber calls that will eventually unwind back to
|
||||
the main fiber when all of the called ones yield or finish.</p>
|
||||
<p>This works fine for most uses, but sometimes you want something a little more
|
||||
@ -204,7 +204,7 @@ You just want to <em>transfer</em> to the next fiber and forget about the previo
|
||||
entirely. (This is analogous to <a href="http://en.wikipedia.org/wiki/Tail_call">tail call
|
||||
elimination</a> for regular function
|
||||
calls.)</p>
|
||||
<p>To enable this, fibers also have a <code>run</code> method. This begins executing that
|
||||
<p>To enable this, fibers also have a <code>run()</code> method. This begins executing that
|
||||
fiber, and "forgets" the previous one. If the running fiber yields or ends, it
|
||||
will transfer control back to the last <em>called</em> one. (If there are no called
|
||||
fibers, it will end execution.)</p>
|
||||
|
||||
@ -124,17 +124,17 @@ return that, so this exists purely as a convenience method for you.</p>
|
||||
so by calling a method on it:</p>
|
||||
<div class="codehilite"><pre><span class="kd">class</span> <span class="nc">Blondie</span> <span class="p">{</span>
|
||||
<span class="n">callMe</span><span class="p">(</span><span class="n">fn</span><span class="p">)</span> <span class="p">{</span>
|
||||
<span class="n">fn</span><span class="p">.</span><span class="n">call</span>
|
||||
<span class="n">fn</span><span class="p">.</span><span class="n">call</span><span class="p">()</span>
|
||||
<span class="p">}</span>
|
||||
<span class="p">}</span>
|
||||
</pre></div>
|
||||
|
||||
|
||||
<p>Functions expose a <code>call</code> method that executes the body of the function. This
|
||||
<p>Functions expose a <code>call()</code> method that executes the body of the function. This
|
||||
method is dynamically-dispatched like any other, so you can define your own
|
||||
"function-like" classes and pass them to methods that expect "real" functions.</p>
|
||||
<div class="codehilite"><pre><span class="kd">class</span> <span class="nc">FakeFn</span> <span class="p">{</span>
|
||||
<span class="n">call</span> <span class="p">{</span>
|
||||
<span class="n">call</span><span class="p">()</span> <span class="p">{</span>
|
||||
<span class="n">IO</span><span class="p">.</span><span class="n">print</span><span class="p">(</span><span class="s2">"I'm feeling functional!"</span><span class="p">)</span>
|
||||
<span class="p">}</span>
|
||||
<span class="p">}</span>
|
||||
@ -200,9 +200,9 @@ function references a variable <code>i</code> declared outside of the function.
|
||||
the function is returned from <code>create</code>, it is still able to read and assign
|
||||
to<code>i</code>:</p>
|
||||
<div class="codehilite"><pre><span class="kd">var</span> <span class="n">counter</span> <span class="o">=</span> <span class="n">Counter</span><span class="p">.</span><span class="n">create</span>
|
||||
<span class="n">IO</span><span class="p">.</span><span class="n">print</span><span class="p">(</span><span class="n">counter</span><span class="p">.</span><span class="n">call</span><span class="p">)</span> <span class="c1">// Prints "1".</span>
|
||||
<span class="n">IO</span><span class="p">.</span><span class="n">print</span><span class="p">(</span><span class="n">counter</span><span class="p">.</span><span class="n">call</span><span class="p">)</span> <span class="c1">// Prints "2".</span>
|
||||
<span class="n">IO</span><span class="p">.</span><span class="n">print</span><span class="p">(</span><span class="n">counter</span><span class="p">.</span><span class="n">call</span><span class="p">)</span> <span class="c1">// Prints "3".</span>
|
||||
<span class="n">IO</span><span class="p">.</span><span class="n">print</span><span class="p">(</span><span class="n">counter</span><span class="p">.</span><span class="n">call</span><span class="p">())</span> <span class="c1">// Prints "1".</span>
|
||||
<span class="n">IO</span><span class="p">.</span><span class="n">print</span><span class="p">(</span><span class="n">counter</span><span class="p">.</span><span class="n">call</span><span class="p">())</span> <span class="c1">// Prints "2".</span>
|
||||
<span class="n">IO</span><span class="p">.</span><span class="n">print</span><span class="p">(</span><span class="n">counter</span><span class="p">.</span><span class="n">call</span><span class="p">())</span> <span class="c1">// Prints "3".</span>
|
||||
</pre></div>
|
||||
</main>
|
||||
</div>
|
||||
|
||||
@ -73,7 +73,7 @@ a familiar, modern <a href="syntax.html">syntax</a>.</p>
|
||||
<span class="p">[</span><span class="s2">"small"</span><span class="p">,</span> <span class="s2">"clean"</span><span class="p">,</span> <span class="s2">"fast"</span><span class="p">].</span><span class="n">map</span> <span class="p">{</span><span class="o">|</span><span class="n">word</span><span class="o">|</span> <span class="n">Fiber</span><span class="p">.</span><span class="n">yield</span><span class="p">(</span><span class="n">word</span><span class="p">)</span> <span class="p">}</span>
|
||||
<span class="p">}</span>
|
||||
|
||||
<span class="k">while</span> <span class="p">(</span><span class="o">!</span><span class="n">adjectives</span><span class="p">.</span><span class="n">isDone</span><span class="p">)</span> <span class="n">IO</span><span class="p">.</span><span class="n">print</span><span class="p">(</span><span class="n">adjectives</span><span class="p">.</span><span class="n">call</span><span class="p">)</span>
|
||||
<span class="k">while</span> <span class="p">(</span><span class="o">!</span><span class="n">adjectives</span><span class="p">.</span><span class="n">isDone</span><span class="p">)</span> <span class="n">IO</span><span class="p">.</span><span class="n">print</span><span class="p">(</span><span class="n">adjectives</span><span class="p">.</span><span class="n">call</span><span class="p">())</span>
|
||||
</pre></div>
|
||||
|
||||
|
||||
|
||||
@ -155,7 +155,7 @@ gap:</p>
|
||||
|
||||
|
||||
<p>If you want to remove everything from the list, you can clear it:</p>
|
||||
<div class="codehilite"><pre><span class="n">hirsute</span><span class="p">.</span><span class="n">clear</span>
|
||||
<div class="codehilite"><pre><span class="n">hirsute</span><span class="p">.</span><span class="n">clear</span><span class="p">()</span>
|
||||
<span class="n">IO</span><span class="p">.</span><span class="n">print</span><span class="p">(</span><span class="n">hirsute</span><span class="p">)</span> <span class="c1">// []</span>
|
||||
</pre></div>
|
||||
</main>
|
||||
|
||||
@ -126,8 +126,8 @@ key.</p>
|
||||
|
||||
<p>If the key wasn't in the map to begin with, <code>remove()</code> just returns <code>null</code>.</p>
|
||||
<p>If you want to remove <em>everything</em> from the map, just like with <a href="lists.html">lists</a>, you
|
||||
can just call <code>clear</code>:</p>
|
||||
<div class="codehilite"><pre><span class="n">capitals</span><span class="p">.</span><span class="n">clear</span>
|
||||
can just call <code>clear()</code>:</p>
|
||||
<div class="codehilite"><pre><span class="n">capitals</span><span class="p">.</span><span class="n">clear</span><span class="p">()</span>
|
||||
<span class="n">IO</span><span class="p">.</span><span class="n">print</span><span class="p">(</span><span class="n">capitals</span><span class="p">.</span><span class="n">count</span><span class="p">)</span> <span class="c1">// "0".</span>
|
||||
</pre></div>
|
||||
|
||||
|
||||
4
qa.html
4
qa.html
@ -107,14 +107,14 @@ prototypes) that classes are more usable.</p>
|
||||
<span class="p">}</span>
|
||||
|
||||
<span class="c1">// create and use an Account</span>
|
||||
<span class="kd">var</span> <span class="n">acc</span> <span class="o">=</span> <span class="k">new</span> <span class="n">Account</span><span class="p">(</span><span class="m">100</span><span class="p">)</span>
|
||||
<span class="kd">var</span> <span class="n">acc</span> <span class="o">=</span> <span class="k">new</span> <span class="n">Account</span><span class="p">(</span><span class="m">1000</span><span class="p">)</span>
|
||||
<span class="n">acc</span><span class="p">.</span><span class="n">withdraw</span><span class="p">(</span><span class="m">100</span><span class="p">)</span>
|
||||
</pre></div>
|
||||
|
||||
|
||||
<p>Classes have a reputation for complexity because most of the widely used
|
||||
languages with them are quite complex: C++, Java, C#, Ruby, and Python. I hope
|
||||
to show with Wren that is those languages that are complex, and not classes
|
||||
to show with Wren that it is those languages that are complex, and not classes
|
||||
themselves.</p>
|
||||
<p>Smalltalk, the language that inspired most of those languages, is famously
|
||||
simple. Its syntax <a href="http://www.jarober.com/blog/blogView?showComments=true&title=Readability+is+Key&entry=3506312690">fits on an index card</a>. My aim is to keep Wren that
|
||||
|
||||
27
style.css
27
style.css
@ -178,16 +178,26 @@ body.core footer a {
|
||||
body.core footer a:hover {
|
||||
color: #1fad66; }
|
||||
|
||||
table.chart {
|
||||
table {
|
||||
width: 100%;
|
||||
padding-left: 25px; }
|
||||
border-collapse: collapse; }
|
||||
table tr {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
vertical-align: top; }
|
||||
table th, table td {
|
||||
font-size: 14px;
|
||||
line-height: 20px;
|
||||
text-align: left; }
|
||||
|
||||
table.chart {
|
||||
padding: 5px 0 5px 25px; }
|
||||
table.chart td, table.chart th {
|
||||
line-height: 14px;
|
||||
margin: 0;
|
||||
padding: 0; }
|
||||
table.chart th {
|
||||
font-size: 14px;
|
||||
text-align: left;
|
||||
width: 100px; }
|
||||
table.chart .chart-bar {
|
||||
display: inline-block;
|
||||
@ -201,6 +211,17 @@ table.chart {
|
||||
background: #1d5176;
|
||||
border-bottom: solid 1px #143352; }
|
||||
|
||||
table.precedence th {
|
||||
font: 500 11px "Lato", helvetica, arial, sans-serif;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 1px;
|
||||
color: #888c90;
|
||||
padding: 6px 0;
|
||||
border-bottom: solid 1px #ebebec; }
|
||||
table.precedence td {
|
||||
padding: 3px 0;
|
||||
border-bottom: solid 1px #ebebec; }
|
||||
|
||||
@media only screen and (max-width: 839px) {
|
||||
.page {
|
||||
width: 720px; }
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"version": 3,
|
||||
"mappings": "AA+BA,CAAE;EACA,eAAe,EAAE,UAAU;EAC3B,UAAU,EAAE,UAAU;;AAGxB,8BAA+B;EAC7B,MAAM,EAAE,CAAC;EACT,OAAO,EAAE,CAAC;;AAGZ,IAAK;EACH,UAAU,EAnCJ,KAAgB;EAoCtB,KAAK,EA3BA,OAAsB;EA4B3B,IAAI,EAAE,2CAAe;;AAGvB,KAAM;EACJ,MAAM,EAAE,MAAM;EACd,KAAK,EAAE,KAAK;EAGZ,WAAQ;IACN,OAAO,EAAE,EAAE;IACX,OAAO,EAAE,KAAK;IACd,KAAK,EAAE,IAAI;;AAIf,kBAAa;EACX,QAAQ,EAAE,QAAQ;EAClB,KAAK,EAAE,KAAK;;AAGd,MAAO;EACL,WAAW,EAAE,iBAAiB;EAM9B,UAAU,EAlEL,OAAkB;EAmEvB,aAAa,EAAE,iBAAiB;EALhC,YAAM;IACJ,MAAM,EAAE,KAAK;EAMf,SAAG;IACD,QAAQ,EAAE,QAAQ;IAClB,IAAI,EAAE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AI;IACX,KAAK,EAAE,IAAI;;EAGb,GAAI;IACF,SAAS,EAAE,IAAI;;EAGjB,MAAO;IACL,OAAO,EAAE,mBAAmB",
|
||||
"sources": ["../../doc/site/style.scss"],
|
||||
"names": [],
|
||||
"file": "style.css"
|
||||
|
||||
Reference in New Issue
Block a user