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: Martin DeMello
Subject: Re: [Chicken-users] passing a string to foreign-lambda*
Date: Sun, 8 Jul 2007 23:38:12 +0530

On 7/8/07, Alex Queiroz <address@hidden> wrote:
On 7/8/07, Martin DeMello <address@hidden> wrote:
> Is there any way to do this?
>
> (define str "hello")
> (foreign-lambda* int ((int x)) str)
>

(define str "Hello")

(define my-func
     (let ((foreign (foreign-lambda* int ((int x) (c-string str))
                          "do stuff with x and str...")))
       (lambda (x)
         (foreign x str))))

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.

martin




reply via email to

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