https://github.com/db7/callseq
Experimental callback sequencer for CHICKEN Scheme
https://github.com/db7/callseq
Last synced: about 1 year ago
JSON representation
Experimental callback sequencer for CHICKEN Scheme
- Host: GitHub
- URL: https://github.com/db7/callseq
- Owner: db7
- License: 0bsd
- Created: 2025-03-20T10:32:50.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-03-20T12:11:50.000Z (over 1 year ago)
- Last Synced: 2025-03-20T12:33:35.662Z (over 1 year ago)
- Language: C
- Size: 185 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Experimental callback sequencer for CHICKEN Scheme
Install the package
chicken-install callseq
Then define the functions you want to make external:
```
(import (chicken platform)
callseq)
(define-sequenced-callback (foo (int a)) int
(* a a))
(return-to-host)
```
We expect CHICKEN to be embedded into some C program, so you have to return to
host after loading the module.
CHICKEN is initialized via `callseq_init()`, after that you can call
the external function:
```
#include
#include
void callseq_init(void);
int foo(int a);
int main() {
callseq_init();
int x = 4;
int y = foo(x);
printf("(foo x) = (foo %d) = %d\n", x, y);
return 0;
}
```
See `example/` directory and `bench/` directory.
# License
Files in vendor/ contain license information in each file. The remainder of this
repository is distributed under 0-clause BSD license (see LICENSE file).