[gambit-list] automatic int -> double conversion

lowly coder lowlycoder at huoyanjinjing.com
Wed May 20 12:45:31 EDT 2009


Please see attached typescript. What am I doing wrong with my c-to-scheme
and scheme-to-c functions?

c-define-type has a form of:

(c-define-type type type c-to-scheme scheme-to-c)

Thanks!

(I want this lax-double to be a type where I can send it ints and it'll
autoamtically become doubles)

On Tue, May 19, 2009 at 1:48 PM, Marc Feeley <feeley at iro.umontreal.ca>wrote:

>
> On 19-May-09, at 4:44 PM, lowly coder wrote:
>
>  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)
>>
>
> 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).
>
> Marc
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.iro.umontreal.ca/pipermail/gambit-list/attachments/20090520/ea25af4f/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: typescript
Type: application/octet-stream
Size: 449 bytes
Desc: not available
URL: <http://mailman.iro.umontreal.ca/pipermail/gambit-list/attachments/20090520/ea25af4f/attachment.obj>


More information about the Gambit-list mailing list