Skip to content

Instantly share code, notes, and snippets.

@olsonjeffery
Created July 15, 2010 23:23
Show Gist options
  • Save olsonjeffery/477696 to your computer and use it in GitHub Desktop.
Save olsonjeffery/477696 to your computer and use it in GitHub Desktop.
import structs/ArrayList
main: func {
list := ArrayList<int> new()
for (i in 0..10) list add(i)
anotherList := list filter(|x| x <= 5)
anotherList each(|x| (x toString()) println() )
}
jeff@ubuntu:~/src/ooc$ rock foo
./foo.ooc:7:27 [ERROR] No such function toString() for `T` (you can't call methods on generic types! you have to cast them first)
anotherList each(|x| (x toString()) println() )
~~~~~~~~
[FAIL]
jeff@ubuntu:~/src/ooc$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment