| 1 |
;;; |
| 2 |
;;; spigot - 'spigot' extension module example |
| 3 |
;;; |
| 4 |
;;; Written by Shiro Kawai ([email protected]) |
| 5 |
;;; I put this program in public domain. Use it as you like. |
| 6 |
;;; |
| 7 |
|
| 8 |
(in-module math.spigot) |
| 9 |
|
| 10 |
;; |
| 11 |
;; The 'define-cproc' forms exposes C functions to Scheme world. |
| 12 |
;; |
| 13 |
|
| 14 |
(inline-stub |
| 15 |
(.include "spigot.h") |
| 16 |
(define-cproc spigot-calculate-pi (digits::<int>) Spigot_calculate_pi) |
| 17 |
(define-cproc spigot-calculate-e (digits::<int>) Spigot_calculate_e) |
| 18 |
) |
| 19 |
|
| 20 |
;; You can define Scheme functions here if you want. |