chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] passing a string to foreign-lambda*


From: felix winkelmann
Subject: Re: [Chicken-users] passing a string to foreign-lambda*
Date: Mon, 9 Jul 2007 09:12:14 +0200

On 7/8/07, Martin DeMello <address@hidden> wrote:

No, I want a C function whose body is a string generated by combining
a template and some arguments that fill in slots in the template.


(define-macro (foo name x)
 `(define ,name
     (foreign-lambda* void ((c-string arg))
       ,(format #f "printf(\"~a, %s!\\n\", arg);" x) ) ) )

(foo hello "Hello")
(hello "martin")


?


cheers,
felix




reply via email to

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