Code is:<div><br></div><blockquote class="webkit-indent-blockquote" style="margin:0 0 0 40px;border:none;padding:0px"><div><div><font class="Apple-style-span" face="'courier new', monospace">main(!IO) :-</font></div>
</div><div><div><font class="Apple-style-span" face="'courier new', monospace"> N = (func(X) = ((func) = X)),</font></div></div><div><div><font class="Apple-style-span" face="'courier new', monospace"> A = (func(K, X1, X2, X3, X4, X5) = </font></div>
</div><div><div><font class="Apple-style-span" face="'courier new', monospace"> (B = ((func) = apply(A, K - 1, B, X1, X2, X3, X4))),</font></div></div><div><div><font class="Apple-style-span" face="'courier new', monospace"> (K =< 0 -></font></div>
</div><div><div><font class="Apple-style-span" face="'courier new', monospace"> apply(X4) + apply(X5)</font></div></div><div><div><font class="Apple-style-span" face="'courier new', monospace"> ;</font></div>
</div><div><div><font class="Apple-style-span" face="'courier new', monospace"> apply(B)</font></div></div><div><div><font class="Apple-style-span" face="'courier new', monospace"> )</font></div>
</div><div><div><font class="Apple-style-span" face="'courier new', monospace"> ),</font></div></div><div><div><font class="Apple-style-span" face="'courier new', monospace"> io.write_int(apply(A, 10, apply(N, 1), apply(N, -1), apply(N, -1), apply(N, 1), apply(N,0)), !IO),</font></div>
</div><div><div><font class="Apple-style-span" face="'courier new', monospace"> io.write_string("\n", !IO).</font></div></div></blockquote><div><br></div><div>(The line number for main/2 is 28.)</div>
<div><br></div><div>Errors generated from this:</div><div><br></div><div><div>man_or_boy.m:030: In clause for predicate `main'/2:</div><div>man_or_boy.m:030: error: the language construct `,'/2 should be used as a</div>
<div>man_or_boy.m:030: goal, not as an expression.</div><div>man_or_boy.m:030: If you are trying to use a goal as a boolean function, you</div><div>man_or_boy.m:030: should write `if <goal> then yes else no' instead.</div>
<div>man_or_boy.m:031: In clause for predicate `main'/2:</div><div>man_or_boy.m:031: in argument 1 of clause head:</div><div>man_or_boy.m:031: error: the language construct `='/2 should be used as a</div><div>
man_or_boy.m:031: goal, not as an expression.</div><div>man_or_boy.m:031: If you are trying to use a goal as a boolean function, you</div><div>man_or_boy.m:031: should write `if <goal> then yes else no' instead.</div>
<div>man_or_boy.m:031: In clause for predicate `main'/2:</div><div>man_or_boy.m:031: in argument 2 of functor `,/2':</div><div>man_or_boy.m:031: error: undefined symbol `+/2'.</div><div>man_or_boy.m:031: In clause for predicate `main'/2:</div>
<div>man_or_boy.m:031: in function result term of clause head:</div><div>man_or_boy.m:031: in argument 2 of functor `apply/7':</div><div>man_or_boy.m:031: error: undefined symbol `-/2'.</div><div>man_or_boy.m:031: In clause for predicate `man_or_boy.main'/2:</div>
<div>man_or_boy.m:031: warning: variable `X5' occurs only once in this scope.</div><div>man_or_boy.m:031: In clause for predicate `man_or_boy.main'/2:</div><div>man_or_boy.m:031: warning: variables `K, X4, X5' each have overlapping</div>
<div>man_or_boy.m:031: scopes.</div><div>man_or_boy.m:032: In clause for predicate `main'/2:</div><div>man_or_boy.m:032: error: undefined predicate `=<'/2.</div><div>man_or_boy.m:032: In clause for predicate `man_or_boy.main'/2:</div>
<div>man_or_boy.m:032: warning: variable `K' occurs only once in this scope.</div><div>man_or_boy.m:033: In clause for predicate `man_or_boy.main'/2:</div><div>man_or_boy.m:033: warning: variable `X4' occurs only once in this scope.</div>
<div>man_or_boy.m:033: In clause for predicate `man_or_boy.main'/2:</div><div>man_or_boy.m:033: warning: variable `X5' occurs only once in this scope.</div></div><div><br></div><div>If I replace the entire body of the lambda assigned to A with, say, 67 or an apply(X1) I have no problems (aside from warnings about unused variables).</div>
<div><br></div><div>How can I do what I want to do?</div><div><div><br></div>-- <br>"Perhaps people don't believe this, but throughout all of the discussions of entering China our focus has really been what's best for the Chinese people. It's not been about our revenue or profit or whatnot."<br>
--Sergey Brin, demonstrating the emptiness of the "don't be evil" mantra.<br>
</div>