Skip to content

Instantly share code, notes, and snippets.

@mshroyer
Created October 19, 2011 18:55
Show Gist options
  • Save mshroyer/1299297 to your computer and use it in GitHub Desktop.
Save mshroyer/1299297 to your computer and use it in GitHub Desktop.
Chicken Scheme question
=== 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