[plt-scheme] [ANN] SuperC 2.0 --- Now with more evil

From: Jay McCarthy (jay.mccarthy at gmail.com)
Date: Sat Nov 7 12:50:06 EST 2009

A new version of SuperC is available:

http://planet.plt-scheme.org/display.ss?package=superc.plt&owner=jaymccarthy

Here's an example:

#lang planet jaymccarthy/superc

@c{
 #include <stdio.h>
 #include <math.h>
}

(define-for-syntax y 6)

@c{
int main(void) {
 printf("The Scheme program contains: @|y|\n");
 return cos(M_PI);
}
}

(define main (get-ffi-obj-from-this 'main (_fun -> _int)))

(printf "The C program returned: ~a~n"
        (main))

It outputs:

The Scheme program contains: 6
The C program returned: -1

-- 
Jay McCarthy <jay at cs.byu.edu>
Assistant Professor / Brigham Young University
http://teammccarthy.org/jay

"The glory of God is Intelligence" - D&C 93


Posted on the users mailing list.