Created
January 27, 2010 00:38
-
-
Save joshthecoder/287417 to your computer and use it in GitHub Desktop.
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
define: func -> Func { | |
return func { printf("X is %d\n", 28) } | |
} | |
f: Func | |
f = define() | |
f() |
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
ooc_tmp/ooc/test.c: In function ‘_test_load’: | |
ooc_tmp/ooc/test.c:27: warning: implicit declaration of function ‘f’ | |
/tmp/cc2GywQN.o: In function `_test_load': | |
test.c:(.text+0x61): undefined reference to `f' |
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
/* test source file, generated with ooc */ | |
#include "test.h" | |
#include <sdk/lang/memory.h> | |
#include <sdk/lang/stdio.h> | |
#include <sdk/lang/ooclib.h> | |
#include <sdk/lang/BasicTypes.h> | |
void (*test__define())() { | |
return test___test_closure; | |
} | |
void test___test_closure() { | |
printf("X is %d\n", 28); | |
} | |
void _test_load(){ | |
static bool __done__ = false; | |
if (!__done__){ | |
__done__ = true; | |
_lang_memory_load(); | |
_lang_stdio_load(); | |
_lang_ooclib_load(); | |
_lang_BasicTypes_load(); | |
test__f = test__define(); | |
f(); | |
} | |
} | |
int main(){ | |
GC_INIT(); | |
_test_load(); | |
} | |
void (*test__f)(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment