Advertisement
Guest User

ffi.scm

a guest
Sep 20th, 2014
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. (load-library "scheme")
  2. (scheme-interaction-mode)
  3.  
  4. (use-modules ((elisp-symbols) #:prefix ev-)
  5. ((elisp-functions) #:prefix ef-)
  6. ((elisp-plists) #:prefix ep-))
  7.  
  8. (ef-message (ef-symbol-name 'cool!))
  9.  
  10. ;; https://www.gnu.org/software/guile/manual/html_node/Dynamic-FFI.html
  11.  
  12.  
  13. (define-module (math bessel)
  14. #:use-module (system foreign)
  15. #:export (j0))
  16.  
  17. (define libm (dynamic-link "libm"))
  18.  
  19. (define j0
  20. (pointer->procedure double
  21. (dynamic-func "j0" libm)
  22. (list double)))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement