-
Notifications
You must be signed in to change notification settings - Fork 1
/
example.ss
52 lines (33 loc) · 1.03 KB
/
example.ss
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
(import (only (meevax procedure) procedure)
(scheme base)
(scheme process-context)
(scheme write)
(srfi 78))
(display (get-environment-variable "LD_LIBRARY_PATH"))
(newline)
(define libexample
(cond-expand (darwin "libexample.dylib")
(linux "libexample.so")))
(define dummy-procedure
(procedure libexample 'dummy_procedure))
(check (procedure? dummy-procedure) => #t)
(check (dummy-procedure 'hoge 42 #(1 2 3) 3.14) => 43)
(define argument-length
(procedure libexample 'argument_length))
(check (procedure? argument-length) => #t)
(check (argument-length 'hoge 42 #(1 2 3) 3.14) => 4)
(define make-hoge
(procedure libexample 'make_hoge))
(define hoge?
(procedure libexample 'is_hoge))
(define hoge-value
(procedure libexample 'hoge_value))
(check (procedure? make-hoge) => #t)
(check (procedure? hoge?) => #t)
(check (procedure? hoge-value) => #t)
(define h (make-hoge 100))
(display h)
(newline)
(check (hoge? h) => #t)
(check (hoge-value h) => 100)
(exit (check-passed? 9))