Commit | Line | Data |
---|---|---|
31690700 JM |
1 | |
2 | ;; Testing FFI of "strlen" | |
3 | (. nil "int32" "strlen" "string" "abcde") | |
4 | ;=>5 | |
5 | (. nil "int32" "strlen" "string" "") | |
6 | ;=>0 | |
7 | ||
8 | ;; Testing FFI of "strcmp" | |
9 | ||
10 | (. nil "int32" "strcmp" "string" "abc" "string" "abcA") | |
11 | ;=>-65 | |
12 | (. nil "int32" "strcmp" "string" "abcA" "string" "abc") | |
13 | ;=>65 | |
14 | (. nil "int32" "strcmp" "string" "abc" "string" "abc") | |
15 | ;=>0 | |
16 | ||
17 | ||
18 | ;; Testing FFI of "pow" (libm.so) | |
19 | ||
20 | (. "libm.so" "double" "pow" "double" 2.0 "double" 3.0) | |
21 | ;=>8.000000 | |
22 | (. "libm.so" "double" "pow" "double" 3.0 "double" 2.0) | |
23 | ;=>9.000000 |