guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Pierre Lindenbaum
Subject: Re: using guile like a awk filter in a C program.
Date: Tue, 21 May 2024 15:39:58 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0

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 Scheme from C

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 include the user's script in
a larger script that would include the definitions of `variant-is-snp?`
, `variant-allele-count`, etc...
Maybe modules?

right, if I call scheme fro C should I put my library in a directory or is 
there any way to embed the code in the C executable (in a const char*...)

What you want to replace is the driver – currently implemented in AWK.
You would like to have the driver (glue code) in Guile.  Is it correct?

hum not sure .. again, here my program is a C code, and I want to provide a 
guile program that would be used as a filter for each record.


./my-c-program --filter '(and (is-male?) (is-german?) )' persons.data > 
male_from_germany.data


I hope it's clearer now


Pierre





reply via email to

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