On 7/9/07, felix winkelmann <[EMAIL PROTECTED]> wrote:
On 7/8/07, Martin DeMello <[EMAIL PROTECTED]> 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")

Thanks! I was trying to use string-concatenate, but couldn't manage to
make it available at macro expansion time (is this possible?)

martin


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

Reply via email to