Skip to content

Instantly share code, notes, and snippets.

@joshthecoder
Created January 27, 2010 00:38
Show Gist options
  • Save joshthecoder/287417 to your computer and use it in GitHub Desktop.
Save joshthecoder/287417 to your computer and use it in GitHub Desktop.
define: func -> Func {
return func { printf("X is %d\n", 28) }
}
f: Func
f = define()
f()
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'
/* 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