>it looks ugly. Currently the user just define the 'filter' part and then I
>include this string in a larger code. Ant how should I design this if I want
>to include modules, custom functions,... ?
I propose replacing the interface for filter part by (lambda (record) [more
code here]) and eval
Note that the scheme shell (scsh) has an awk implementation using
macros. Maybe the code helps:
https://carlstrom.com/publications/scsh-manual.pdf
On Fri, May 10, 2024 at 03:55:58PM +0200, Pierre LINDENBAUM wrote:
>
> Hi all,
>
> I tried to learn guile a few years ago with a side project that w
Hello Pierre,
To me it looks like the easiest way could be to think of a declarative
description of your filters and put that into a JSON file and read that as input
(or similar file format), rather than using a whole programming language.
Is there a specific requirement, that makes a JSON fi
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
Hi Pierre,
> I want to call scheme from C.
Well, I would start with:
https://www.gnu.org/software/guile/manual/html_node/A-Sample-Guile-Main-Program.html
Then maybe:
https://www.gnu.org/software/guile/manual/html_node/General-Libguile-Concepts.html
Personally, I have never done that. The me
Hello Pierre,
(if you reply privately, feel free to reply in French, we both are French)
You definitely could use libguile in your C program. Since Guile has a
conservative garbage collector, and assuming your program is
single-threaded, this should be reasonably easy. If your C program needs
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
Hi,
On Fri, 10 May 2024 at 15:55, Pierre LINDENBAUM
wrote:
> ```
> header = read_header(input);
> guile_context = my_initialize_guile(header, argc_argv_user_script)
> variant = new_variant();
> while(read_variant(input,header,variant)) {
> if(!my_guil