chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] foreign-lambda* problems on Mac OS X


From: Raffael Cavallaro
Subject: Re: [Chicken-users] foreign-lambda* problems on Mac OS X
Date: Wed, 13 Jul 2005 11:14:29 -0400


On Jul 13, 2005, at Wed, Jul 13, 8:19 16 AM, Thomas Chust wrote:

#>! ... <# 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)));

  }

}

<#


Thanks for pointing this out - It certainly makes things much easier for me.

I must look pretty obtuse - I didn't realize it could be used this way. All the C examples in the manual are for #includes and function declarations/prototypes but never function bodies, and the manual warns that the foreign parser can only deal with a limited subset of C.  So I thought that foreign-lambda* was needed for the actual inline C function bodies. Clearly as you point out it is not, which is really nice.

I'm more impressed with Chicken every day. Thanks again for your help.

regards,

Ralph

Raffael Cavallaro, Ph.D.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]