Executable library: Difference between revisions

Content added Content deleted
m (→‎{{header|REXX}}: fixed a "HTML" tag. -- ~~~~)
(→‎{{header|Limbo}}: Hopefully this should clarify.)
Line 543: Line 543:


=={{header|Limbo}}==
=={{header|Limbo}}==

{{incomplete|Limbo|Unsure from the output whether execution of execlib.b on its own produces first part of output independant of any later calls to execsexeclib.b}}
There's no real difference in compilation or output for libraries versus commands in Inferno; commands (by convention) are expected to define an <code>init()</code> function that accepts a reference to a graphical context and a list of strings (i.e., the argument list) in order to satisy the type-checker. So this task is fairly simple. First, <code>execlib.b</code> looks like this:
There's no real difference in compilation or output for libraries versus commands in Inferno; commands (by convention) are expected to define an <code>init()</code> function that accepts a reference to a graphical context and a list of strings (i.e., the argument list) in order to satisy the type-checker. So this task is fairly simple. First, <code>execlib.b</code> looks like this:


Line 654: Line 654:
<pre>
<pre>
% apply {limbo $1} *execlib.b
% apply {limbo $1} *execlib.b
% ./execlib
% apply {echo Running $1; $1} *execlib.dis
Running execlib.dis
hailstone(27): 27, 82, 41, 124, ⋯, 8, 4, 2, 1 (length 112)
hailstone(27): 27, 82, 41, 124, ⋯, 8, 4, 2, 1 (length 112)
hailstone(77031) has length 351
hailstone(77031) has length 351
Running execsexeclib.dis
% ./execsexeclib
The most common sequence length is 72 (encountered 1467 times)
The most common sequence length is 72 (encountered 1467 times)
</pre>
</pre>