Update foreign.md

This commit is contained in:
Justin Ethier 2021-01-27 22:42:31 -05:00 committed by GitHub
parent cf1240eb4e
commit c3da074f7b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -75,10 +75,8 @@ Scheme | C
Useful notes:
- Use `opaque` if you need to handle any kind of C pointer.
- Use `string` to handle C `const char*` (`symbol` is strictly used to represent Scheme symbols).
- `thread-data` is a special type used to pass the current thread's `gc_thread_data` instance to a C function. These objects are passed implicitly when making a Scheme function call.
- `thread-data` is a special type used to pass the current thread's `gc_thread_data` instance to a C function. These objects are passed implicitly when making a Scheme function call. For example:
(c-define sub-big-nums bignum "sub_big_nums" thread-data bignum bignum)
(sub-big-nums
999999999999999999999999
222222222222222222222222))
(c-define sub-big-nums bignum "sub_big_nums" thread-data bignum bignum)
(sub-big-nums 999999999999999999999999 222222222222222222222222))