mirror of
https://github.com/justinethier/cyclone.git
synced 2025-05-23 20:15:05 +02:00
17 lines
515 B
Scheme
17 lines
515 B
Scheme
;; A basic example of subtracting 2 bignums using the FFI.
|
|
;;
|
|
;; This example is notable because we need to pass the
|
|
;; current thread's data object to C so that we can pass
|
|
;; it along to functions in the Cyclone runtime.
|
|
;;
|
|
(import (scheme base) (scheme write) (cyclone foreign) (srfi 18))
|
|
(include-c-header "sub-bignums.h")
|
|
|
|
(c-define sub-big-nums bignum "sub_big_nums" opaque bignum bignum)
|
|
|
|
(write
|
|
(sub-big-nums
|
|
(current-thread-data)
|
|
999999999999999999999999
|
|
222222222222222222222222
|
|
))
|