Executable library: Difference between revisions
→{{header|Limbo}}: Hopefully this should clarify.
m (→{{header|REXX}}: fixed a "HTML" tag. -- ~~~~) |
(→{{header|Limbo}}: Hopefully this should clarify.) |
||
Line 543:
=={{header|Limbo}}==
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:
<pre>
% apply {limbo $1} *execlib.b
% ./execlib
hailstone(27): 27, 82, 41, 124, ⋯, 8, 4, 2, 1 (length 112)
hailstone(77031) has length 351
The most common sequence length is 72 (encountered 1467 times)
</pre>
|