Created
July 15, 2010 23:23
-
-
Save olsonjeffery/477696 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
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() ) | |
} |
This file contains hidden or 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
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