Created
May 5, 2010 08:01
-
-
Save nowelium/390516 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
Stream := Object clone do ( | |
create := method(car, cdr, | |
stream := self clone | |
stream car ::= car | |
stream cdr ::= cdr | |
stream | |
) | |
each := method(k, | |
k call(car) | |
cdr each(k) | |
) | |
squareBrackets := method(index, | |
if(index == 0, return car) | |
cdr call [index - 1] | |
) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Fibonacci number @ Stream