Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example of module written in C and Scheme #646

Merged
merged 1 commit into from
Jul 20, 2024

Conversation

jpellegrini
Copy link
Contributor

@egallesio I'm not sure where this example would fit, so I included as a subdirectory of examples. Do you think it makes sense to have this?

This is an example of a STklos module written part in C and part in Scheme.

What we illustrate with this example:

  • Combining C and Scheme to build an STklos module;

  • Selectively exporting symbols from the C file;

  • Referencing, in the Scheme file, symbols defined in the C file;

  • Writing help for procedures, not only in Scheme files, but also in C files.

  • The example was built for Linux, but can be adapted for other systems.

  • In order to write STklos modules in C, it is necessary to understand how typical STklos C code works. This can be found in the hacking file.

This  is an example of a STklos module written part in C and part in Scheme.

What we illustrate with this example:

* Combining C and Scheme to build an STklos module;
* Selectively exporting symbols from the C file;
* Referencing, in the Scheme file, symbols defined in the C file;
* Writing help for procedures, not only in Scheme files, but also
  in C files.

* The example was built for Linux, but can be adapted for other systems.
* In order to write STklos modules in C, it is necessary to understand
  how typical STklos C code works. This can be found in the `hacking` file.
@egallesio egallesio merged commit a3c8d4e into egallesio:master Jul 20, 2024
@egallesio
Copy link
Owner

Hi @jpellegrini,

I have integrated your example (great idea BTW). I have modified the Makefile to permit to compile it with the STklos configuration options and without the need to have stklos previously installed. This Makefile is of course more complicated (generated by a Makefile.in …). So I have let the one you wrote for this PR as Makefile-sample for keeping things as simple as possible.

Thanks for this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants