Re: using guile like a awk filter in a C program.

2024-05-24 Thread Pierre Lindenbaum
I want to call scheme from C. The C loop scans the binary data and a scheme script would be used to accept/reject a record. Something like     ./my-c-program --filter '(and (is-male?) (is-german?) )' persons.data > male_from_germany.data - furthermore, what's the best practice to in

Re: using guile like a awk filter in a C program.

2024-05-21 Thread Pierre Lindenbaum
Thanks for your answer - is it possible to use guile for such task ? More precisely, can I compile the guile script just once in `my_initialize_guile` and use it in the while loop without having to recompile it. I am not sure to well understand. Since, it could be read two ways: + Call Schem

using guile like a awk filter in a C program.

2024-05-10 Thread Pierre LINDENBAUM
Hi all, I tried to learn guile a few years ago with a side project that went nowhere. I'm now back with guile that I would like to use as a filter, just like awk, for my data. I've got question about the general design of such program. My program uses a C library ( https://github.com/samt

how to write a 'configure.ac' for an* optional* support of libguile.

2017-12-15 Thread Pierre Lindenbaum
(Cross-posted https://stackoverflow.com/questions/47819563/how-to-configure-ac-with-optional-gnu-guile-library-with-guile ) Hi all, I'm looking for a simple example of configure.ac for an optional support of libguile I'm a complete beginner with configure.ac, I'm trying to create a simple p

function registered with scm_c_define_gsubr: how can i handle an optional parameter?

2017-12-13 Thread Pierre LINDENBAUM
Hi all, (cross posted on SO: https://stackoverflow.com/questions/47797521 ) I've defined a guile C function: static SCM myfun(SCM arg1,SCM opt_arg2) { return SCM_BOOL_T; } registered with scm_c_define_gsubr ("myfun", 1, 1, 0, myfun); there is one optional argument.