<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#ffffff">
On 08/25/2009 05:46 PM, Jeremy Cowgar wrote:
<blockquote cite="mid:20090825114616.73BA.81C008E5@cowgar.com"
 type="cite">
  <pre wrap="">Now, thinking about this... Maybe the answer is simple? Why not just
output <b class="moz-txt-star"><span class="moz-txt-tag">*</span>all<span
 class="moz-txt-tag">*</span></b> slots in the External section? The resulting .c file will
be a bit larger, however, the C compiler will optimize out a function
that is not used anyway, so the resulting executable will be no
different.
  </pre>
</blockquote>
This is the right thing to do in my opinion. If we created and External
slot, it was to use ut somewhere. We can't throw them away.<br>
<br>
Now, I also have an idea that could replace External slots sometimes:
When blocks are present in externals, just create a function for the
block and put the function pointer in the C code. For example:<br>
<br>
+ blc :{INTEGER;INTEGER};<br>
blc := { i:INTEGER; i};<br>
`use_callback(@blc)`;<br>
<br>
would translate in C:<br>
<br>
<br>
<br>
typedef int (blc_ptr_t*)(int)<br>
void use_callback(blc_ptr_t);<br>
<br>
int blc(int i) {<br>
    return i;<br>
}<br>
<br>
use_callback(blc);<br>
<br>
<pre class="moz-signature" cols="72">-- 
Mildred Ki'Lya
╭───────── mildred593@online.fr ──────────
│ Jabber, GoogleTalk: <a class="moz-txt-link-rfc2396E" href="mailto:mildred@jabber.fr">&lt;mildred@jabber.fr&gt;</a>
│ Website: <a class="moz-txt-link-rfc2396E" href="http://ki.lya.online.fr">&lt;http://ki.lya.online.fr&gt;</a>           GPG ID: 9A7D 2E2B
│ Fingerprint: 197C A7E6 645B 4299 6D37 684B 6F9D A8D6 9A7D 2E2B
</pre>
</body>
</html>