Raffael Cavallaro wrote:
[...]
In the code in question, tak is the scheme name of a foreign-lambda* that calls itself recursively - that is, the takeuchi function call benchmark.

I think that this is a recursion issue, since the basic my-strlen example that Thomas Chust was kind enough to send works fine.
[...]

#>! ... <# already embeds ... verbatim *and* parses it to generate Scheme bindings, so you should simply do it this way:

imurph:~/Unsorted murphy$ cat >tak-fp-c.scm
#>!
float tak(float x, float y, float z) {
  if (y >= x) {
    return (z);
  }
  else {
    return (tak(tak(x-1,y,z), tak(y-1,z,x), tak(z-1,x,y)));
  }
}
<#
imurph:~/Unsorted murphy$ csc -O2 -s tak-fp-c.scm
imurph:~/Unsorted murphy$ csi -quiet
#;1> (use tak-fp-c)
#;2> (tak 3 2 1)
2.0
#;3> ,q

I would suggest you to reread the CHICKEN manual section on the foreign function interface -- it is a very powerful feature but not easy to understand thoroughly at first glance (at least not for me :)

cu,
Thomas Chust


_______________________________________________
Chicken-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/chicken-users

Reply via email to