Fair enough, thanks for the time.<br>I found a thin D binding to ncurses, and 'fixed' it to work with D2. <br>If y'all get this up and running, this code will probably be better than starting from scratch.<br><br>
In any case, I think that CAPI is exactly the type of thing that D needs going forward.<br>I really hope that CAPI gets good support.<br><br><div class="gmail_quote">On Mon, Oct 17, 2011 at 12:55 AM, Walter Bright <span dir="ltr"><<a href="mailto:newshound2@digitalmars.com">newshound2@digitalmars.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="im">On 10/16/2011 9:28 PM, Jude Young wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Please excuse my ignorance,<br>
but several types in D do not currently translate well into C.<br>
<br>
For example, strings in D are not '\0' terminated, which breaks with C.<br>
</blockquote>
<br></div>
This is incorrect. String literals in D are 0 terminated, as in C. C has a convention that strings are 0 terminated, but it isn't part of the core language. In D, you can terminate a string with 0 if you want to, or not.<div class="im">
<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
This is not usually a problem, and it's easy to wrap the function in the<br>
translated header file to automate that particular process.<br>
</blockquote>
<br></div>
This would fall under attempting to fix the api, which would be beyond the scope of the library.<div class="im"><br>
<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
It seems that your proposal would disallow this particular example.<br>
The translation code would have to be somewhere, what is the argument against<br>
allowing it?<br>
</blockquote>
<br></div>
D access to the C API should be direct, and not include hidden costs like translation layers.<div class="im"><br>
<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
In my (admittedly ignorant) opinion, it seems that allowing the automatic<br>
translation of D types to C types<br>
would fit very well, otherwise you'll have to add them yourself every time you<br>
wish to call C.<br>
</blockquote>
<br></div>
C doesn't actually even have a 'string' type.<br>
</blockquote></div><br>