Created
October 19, 2011 18:55
-
-
Save mshroyer/1299297 to your computer and use it in GitHub Desktop.
Chicken Scheme question
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
=== FILE: test2.scm ======================================================= | |
#> | |
#include <stdint.h> | |
uint32_t foreign_proc() | |
{ | |
return UINT32_MAX; | |
} | |
<# | |
(define foreign-proc (foreign-lambda unsigned-integer32 "foreign_proc")) | |
(display (foreign-proc)) | |
(display "\n") | |
=== COMPILATION AND EXECUTION ============================================= | |
$ csc -o test2 test2.scm | |
$ ./test2 | |
4294967295 | |
=== FILE: test3.scm ======================================================= | |
(define foreign-proc (foreign-lambda unsigned-integer32 "foreign_proc")) | |
(display (foreign-proc)) | |
(display "\n") | |
=== FILE: test3-foreign.c ================================================= | |
#include <stdint.h> | |
uint32_t foreign_proc() | |
{ | |
return UINT32_MAX; | |
} | |
=== COMPILATION AND EXECUTION ============================================= | |
$ csc -o test3 test3-foreign.c test3.scm | |
$ ./test3 | |
1.84467440737096e+19 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment