impl.c:
#include <math.h>
float baz(int i)
{
return (((float)i) / 15.2);
}
callit.scm:
(define baz (foreign-lambda float "baz" int))
(display baz)
(display (baz 42))
csc callit.scm impl.c
./callit
#<procedure (baz a25)>42.0
Change impl.c to make sure it's being called at all:
#include <math.h>
#include <stdio.h>
float baz(int i)
{
printf("baz given %d\n", i);
return (((float)i) / 15.2);
}
./callit
#<procedure (baz a25)>baz given 42
13.0
This is with chicken 2.2 and I think 2.3 also has similar problems. I
can try 2.41 when it gets done building.
_______________________________________________
Chicken-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/chicken-users