Skip to content

Instantly share code, notes, and snippets.

@alexnask
Created June 8, 2012 17:28
Show Gist options
  • Select an option

  • Save alexnask/2897061 to your computer and use it in GitHub Desktop.

Select an option

Save alexnask/2897061 to your computer and use it in GitHub Desktop.
/* test source file, generated with rock, the ooc compiler written in ooc */
#include <./test.h>
#include <sdk/lang/String.h>
#include <sdk/lang/BufferIterator.h>
#include <sdk/lang/Abstractions.h>
#include <sdk/lang/System.h>
#include <sdk/lang/Format.h>
#include <sdk/lang/IO.h>
#include <sdk/lang/types.h>
#include <sdk/lang/Character.h>
#include <sdk/lang/Memory.h>
#include <sdk/lang/Buffer.h>
#include <sdk/lang/Iterators.h>
#include <sdk/lang/Numbers.h>
#include <sdk/lang/VarArgs.h>
#include <sdk/lang/Exception.h>
#include <sdk/structs/ArrayList.h>
_lang_array__Array __arrLit187;
structs_ArrayList__ArrayList* test__al;
void test_load() {
static bool __done__ = false;
if (!__done__){
__done__ = true;
lang_String_load();
lang_BufferIterator_load();
lang_Abstractions_load();
lang_System_load();
lang_Format_load();
lang_IO_load();
lang_types_load();
lang_Character_load();
lang_Memory_load();
lang_Buffer_load();
lang_Iterators_load();
lang_Numbers_load();
lang_VarArgs_load();
lang_Exception_load();
structs_ArrayList_load();
__arrLit187 = _lang_array__Array_new(lang_Numbers__SSizeT, 6);
{
lang_Numbers__SSizeT* __ptrLit188 = (lang_Numbers__SSizeT[]) { 0, 1, 2, 3, 4, 5 };
lang_Memory__memcpy(__arrLit187.data, __ptrLit188, 6 * ((lang_types__Class*)lang_Numbers__SSizeT_class())->size);
}
test__al = structs_ArrayList____OP_AS_T__array__ArrayList((lang_types__Class*)lang_Numbers__SSizeT_class(), __arrLit187);
lang_Iterators__Iterable_each((lang_Iterators__Iterable*) test__al, (lang_types__Closure) {
test____test_closure218,
NULL
});
}
}
void test____test_closure218(uint8_t* elem_generic) {
lang_Numbers__Int elem = (* (lang_Numbers__Int*)elem_generic);
;
lang_String__String_println(lang_Numbers__Int_toString(elem));
}
int main() {
GC_INIT();
test_load();
return 0;
}
import structs/ArrayList
al := [0,1,2,3,4,5] as ArrayList<Int>
al each(|elem|
elem toString() println()
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment