Skip to content

Commit 37ccfdb

Browse files
committed
experiment
1 parent 463a9da commit 37ccfdb

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Diff for: corout.fdoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Now we have a transducer which writes the square of every integer it reads.
3838
proc squarer (inp: %<int, out: %>int) () {
3939
while true do
4040
var i = read inp;
41-
write (out, i * I);
41+
write (out, i * i);
4242
done
4343
}
4444
@

Diff for: tmp.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ <h1 id='A_low_level_example._h'><img src='/share/src/web/images/minus.gif' id='A
422422
</p><p><pre class='flxbg'><span class="lineno" id=line1></span> <span class="big_keyword" title="Define a procedure, a function with side-effects not returning a value">proc</span> squarer (inp: %&lt;<span class="library" title="binding of C int type">int</span>, out: %&gt;<span class="library" title="binding of C int type">int</span>) () {
423423
<span class="lineno" id=line2></span> <span class="small_keyword" title="while loop">while</span> <span class="library" title="truth value">true</span> <span class="small_keyword" title="imperative code begins">do</span>
424424
<span class="lineno" id=line3></span> <span class="big_keyword" title="Define a mutable variable">var</span> i = read inp;
425-
<span class="lineno" id=line4></span> <span class="library" title="Print a string to a stream">write</span> (out, i * I);
425+
<span class="lineno" id=line4></span> <span class="library" title="Print a string to a stream">write</span> (out, i * i);
426426
<span class="lineno" id=line5></span> <span class="small_keyword" title="end of body">done</span>
427427
<span class="lineno" id=line6></span> }
428428
</pre></p><p>You should notice the previous three components were all infinite loops.

0 commit comments

Comments
 (0)