Skip to content

Commit

Permalink
integrate feedback from James
Browse files Browse the repository at this point in the history
  • Loading branch information
dalnefre committed Jan 10, 2025
1 parent 195e3df commit 3dc326e
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions site/tutorial/reuse.html
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ <h3 name="tail">Common Tail-Sequences</h3>
These patterns are so common,
they are provided in the
<a href="https://ufork.org/playground/?src=https://ufork.org/lib/std.asm" target="_blank"><code>std.asm</code></a>
module.
module (usually imported with an <code>std</code> prefix).
</p>
<p>
<pre class="code">
Expand Down Expand Up @@ -166,9 +166,9 @@ <h3 name="tail">Common Tail-Sequences</h3>
<p class="text">
A <code>ref</code> occupies no storage.
It's just a reference to another value.
You should use <code>ref commit</code>
You should use <code>ref std.commit</code>
instead of <code>end commit</code>
to avoid creating redundant instructions.
to avoid creating redundant instruction-quads.
The <code>send_msg</code> and <code>cust_send</code>
labels allow sharing of longer common tail-sequences.
Watch for opportunities to use them.
Expand Down Expand Up @@ -203,17 +203,20 @@ <h3 name="static">Static Data</h3>
and an optional <var>next</var> pointer.
As with instructions,
if the final <var>next</var> pointer is missing,
it defaults to the next item in the source code.
it defaults to the next statement in the source code.
The <code>#nil</code> value
represents the empty dictionary,
which terminates the sequence.
Note that the named constants
(<code>#?</code>, <code>#nil</code>, <code>#f</code> and <code>#t</code>)
are <em>pointers</em> to read-only memory.
</p>
<h3 name="dispatch">Method Dispatch Table</h3>
<p class="text">
We begin defining the "storage cell" behavior
by using the staically-defined <code>op_table</code>
to dispatch to the code specified by the <code>op</code>
selector in the incomming message.
selector in the incoming message.
</p>
<p>
<pre class="code">
Expand All @@ -235,7 +238,7 @@ <h3 name="dispatch">Method Dispatch Table</h3>
and there is no effect on the actor or the system.
On some platforms,
an "auditor" may be notified
and the anomoly can be reported.
and the anomaly can be reported.
</p>
<h3 name="read">Read Method</h3>
<p class="text">
Expand All @@ -255,7 +258,7 @@ <h3 name="write">Write Method</h3>
<p class="text">
The "write" method updates the cell's private state
with a new <code>value'</code> from the message,
and sends it's own identity to the provided <code>cust</code>.
and sends its own address to the provided <code>cust</code>.
</p>
<p>
<pre class="code">
Expand All @@ -267,7 +270,7 @@ <h3 name="write">Write Method</h3>
ref std.cust_send</pre>
</p>
<p class="text">
Sending the actor's identity to the customer
Sending the actor's address to the customer
is the "sync signal" pattern.
It allows the customer to continue processing,
knowing that the write has been completed.
Expand Down

0 comments on commit 3dc326e

Please sign in to comment.