On 7/10/07, felix winkelmann <[EMAIL PROTECTED]> wrote:
On 7/10/07, Martin DeMello <[EMAIL PROTECTED]> wrote:
>
> Thanks! I was trying to use string-concatenate, but couldn't manage to
> make it available at macro expansion time (is this possible?)
(require-for-syntax 'sfi-13)
D'oh, I forgot ab
On 7/10/07, Martin DeMello <[EMAIL PROTECTED]> wrote:
Thanks! I was trying to use string-concatenate, but couldn't manage to
make it available at macro expansion time (is this possible?)
(require-for-syntax 'sfi-13)
cheers,
felix
___
Chicken-use
On 7/9/07, Martin DeMello <[EMAIL PROTECTED]> wrote:
Thanks! I was trying to use string-concatenate, but couldn't manage to
make it available at macro expansion time (is this possible?)
Try the "-X" argument to csc:
csc -X byte-string-srfi-13 ... your-source-file.scm
I see there is a "utf8-sr
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
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 #
On 7/9/07, John Cowan <[EMAIL PROTECTED]> wrote:
Yes, that works. However, it occurs to me that if what Martin actually
wants is a C function whose body is some string whose value
is not known until run-time, no amount of fiddling with macros will
accomplish that; C functions have to be known b
Alex Queiroz scripsit:
> I guess this is better:
>
> (define-macro make-foreign
> (lambda (funcs)
>(map
> (lambda (func)
> `(define ,func (foreign-lambda int ,(symbol->string func) int)))
> funcs)))
Yes, that works. However, it occurs to me that if what Martin actually
wa
Hallo,
On 7/8/07, Alex Queiroz <[EMAIL PROTECTED]> wrote:
Ooops. Sorry, you can't do that because make-foreign is not a variable.
I guess this is better:
(define-macro make-foreign
(lambda (funcs)
(map
(lambda (func)
`(define ,func (foreign-lambda int ,(symbol->string
Hallo,
On 7/8/07, Alex Queiroz <[EMAIL PROTECTED]> wrote:
Usage:
(map make-foreign '(func1 func2 func3))
Ooops. Sorry, you can't do that because make-foreign is not a variable.
Cheers,
--
-alex
http://www.ventonegro.org/
___
Chicken-users m
On 7/8/07, John Cowan <[EMAIL PROTECTED]> wrote:
Martin DeMello scripsit:
> 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
Hallo,
On 7/8/07, Martin DeMello <[EMAIL PROTECTED]> 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.
Martin DeMello scripsit:
> 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.
Since foreign-lambda* is itself
On 7/8/07, Alex Queiroz <[EMAIL PROTECTED]> wrote:
On 7/8/07, Martin DeMello <[EMAIL PROTECTED]> 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-strin
Hallo,
On 7/8/07, Martin DeMello <[EMAIL PROTECTED]> 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 a
Is there any way to do this?
(define str "hello")
(foreign-lambda* int ((int x)) str)
(Actually i'm trying to solve the more restricted problem of
generating a call to foreign-lambda* from a macro and synthesising the
string it's passed within the macro, so if the general case has no
answer I'm
15 matches
Mail list logo