2020-10-13 08:37:53 +00:00
|
|
|
#lang racket/base
|
|
|
|
|
2020-10-14 22:17:24 +00:00
|
|
|
(require ffi/unsafe)
|
|
|
|
|
2020-10-13 08:37:53 +00:00
|
|
|
(displayln "hello world")
|
2020-10-14 22:17:24 +00:00
|
|
|
|
|
|
|
(void (for/list ([i (in-list '(1 2 3 4 5))]) (printf "loop: ~a\n" i)))
|
|
|
|
|
|
|
|
(define table (dynamic-require ''static-ffi 'table))
|
|
|
|
(displayln "ffi table")
|
|
|
|
(displayln table)
|
|
|
|
|
|
|
|
(define func (cast (cadr (car table)) _int64 (_fun -> _void)))
|
|
|
|
|
|
|
|
(displayln "calling")
|
|
|
|
(func)
|
|
|
|
(displayln "back")
|