Please see attached typescript. What am I doing wrong with my c-to-scheme and scheme-to-c functions?<br><br>c-define-type has a form of:<br><br>(c-define-type type type c-to-scheme scheme-to-c)<br><br>Thanks!<br><br>(I want this lax-double to be a type where I can send it ints and it'll autoamtically become doubles)<br>
<br><div class="gmail_quote">On Tue, May 19, 2009 at 1:48 PM, Marc Feeley <span dir="ltr"><<a href="mailto:feeley@iro.umontreal.ca">feeley@iro.umontreal.ca</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im"><br>
On 19-May-09, at 4:44 PM, lowly coder wrote:<br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
This is a lot of manual wrapping. Can I define a 'type' like a lenient-double to have this automatically called? (Then I can sed my *.scm for double -> lenient-double)<br>
</blockquote>
<br></div>
Yes you can define your own type with converter functions.  The hardest thing to implement is the conversion of bignums and exact rationals to double (the exact->inexact function does this in Scheme).<br><font color="#888888">
<br>
Marc<br>
<br>
</font></blockquote></div><br>