|
From: | Alex Queiroz |
Subject: | Re: [Chicken-users] passing a string to foreign-lambda* |
Date: | Sun, 8 Jul 2007 15:21:43 -0300 |
Hallo, On 7/8/07, Martin DeMello <address@hidden> wrote:
No, I don't want to pass str into the foreign function, i want str to *be* the foreign function. That is, I want to use a variable rather than an explicit string, or a macro that generates and inserts a string into the right place.
So you want foreign-lambda, and not foreign-lambda*. (define-macro make-foreign (lambda (name) `(define ,name (foreign-lambda int ,(symbol->string name) int)))) Usage: (map make-foreign '(func1 func2 func3)) Cheers, -- -alex http://www.ventonegro.org/
[Prev in Thread] | Current Thread | [Next in Thread] |