[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-users] return a float from foreign function
From: |
John Cowan |
Subject: |
Re: [Chicken-users] return a float from foreign function |
Date: |
Mon, 28 Aug 2006 13:23:31 -0400 |
User-agent: |
Mutt/1.3.28i |
Zbigniew scripsit:
> To fix in your case, add the following to the top of callit.scm.
>
> #> float baz(int); <#
>
> Under normal use, of course, you would use
> #> #include <impl.h> #<
Well, you're right, but I still get the same wrong result: 42.0
> Or use foreign-lambda* and include the code inline.
Now that works:
(define baz (foreign-lambda* float ((int i)) "C_return(((double)i) / 15.2);"))
(print baz)
(print (baz 42))
--
"The serene chaos that is Courage, and the phenomenon address@hidden
of Unopened Consciousness have been known to the John Cowan
Great World eons longer than Extaboulism."
"Why is that?" the woman inquired.
"Because I just made that word up", the Master said wisely.
--Kehlog Albran, The Profit http://www.ccil.org/~cowan
- [Chicken-users] return a float from foreign function, Shawn Rutledge, 2006/08/27
- Re: [Chicken-users] return a float from foreign function, John Cowan, 2006/08/27
- Re: [Chicken-users] return a float from foreign function, Zbigniew, 2006/08/28
- Re: [Chicken-users] return a float from foreign function,
John Cowan <=
- Re: [Chicken-users] return a float from foreign function, Zbigniew, 2006/08/28
- Re: [Chicken-users] return a float from foreign function, John Cowan, 2006/08/28
- Re: [Chicken-users] return a float from foreign function, Zbigniew, 2006/08/28
- Re: [Chicken-users] return a float from foreign function, Shawn Rutledge, 2006/08/28
- Re: [Chicken-users] return a float from foreign function, Zbigniew, 2006/08/28