3rdparties/software/cffi_0.21.0/examples/main-example.lisp (511 bytes)
1 (in-package #:cffi-example) 2 3 (defcfun "puts" :int 4 "Put a string to standard output, return non-negative length output, or EOF" 5 (string :string)) 6 7 (defun check-groveller () 8 (assert (equal (list +a0+ +a1+ +a2+ +a3+ +a4+) '(2 4 8 16 32))) 9 (assert (equal (bn 1) 32))) 10 11 (defun entry-point () 12 (when uiop:*command-line-arguments* 13 (uiop:format! t "Arguments: ~A~%" (uiop:escape-command uiop:*command-line-arguments*))) 14 (puts "hello, world!") 15 (check-groveller) 16 (uiop:finish-outputs) 17 (uiop:quit 0))