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
fn( reduce | |
[?f ?lst] | |
if(empty?(?lst) | |
?f() | |
else | |
?f(first(?lst) | |
reduce(?f rest(?lst))))) | |
reduce(_(1 2 3 4 5) +) |
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
fn( reduce | |
[F Lst] | |
if(empty?(Lst) | |
F() | |
else | |
F(first(Lst) | |
reduce(F rest(Lst))))) | |
reduce(_(1 2 3 4 5) +) |
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
package retweetrec | |
import scala.xml.XML | |
import java.net.URL | |
import java.io.InputStream | |
object ReTweetRec { | |
def getFollowers(id: String) = { | |
val data = new URL("http://twitter.com/followers/ids/" + id + ".xml").getContent |
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
/* | |
{} // map literal syntax | |
() // tuple literal syntax | |
[] // list literal syntax | |
foo // a symbol | |
"foo" // a string | |
foo => bar // a pair | |
:. // a block (similar to progn) | |
= // bind |
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
/* | |
{} // map literal syntax | |
() // tuple literal syntax | |
|| // set literal syntax | |
[] // list literal syntax | |
foo // a symbol | |
"foo" // a string | |
foo => bar // a pair | |
:. // a block (similar to progn) |
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
def foo = {} // start with an empty map | |
foo.n = 42 // put a property | |
foo.z = 0 | |
foo?n // does foo have property n? | |
foo.n // lookup property n | |
def bar = {|| => [print("Hello Cleveland")]} | |
bar() // prints Hello Cleveland | |
bar.|| // returns the list `[print("Hello Cleveland")]` |
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
def foo = {} // start with an empty map | |
foo.n = 42 // put a property | |
foo.z = 0 | |
foo?n // does foo have property n? | |
foo.n // lookup property n | |
def bar = {|| => [print("Hello Cleveland")]} | |
bar() // prints Hello Cleveland | |
bar.|| // returns the list `[print("Hello Cleveland")]` |
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
def foo = {} // start with an empty map | |
foo.n = 42 // put a property | |
foo.z = 0 | |
foo?n // does foo have property n? | |
foo.n // lookup property n | |
def bar = {|| => [print("Hello Cleveland")]} | |
bar() // prints Hello Cleveland | |
bar.|| // returns the list `[print("Hello Cleveland")]` |
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
def foo = {} // start with an empty map | |
foo.n = 42 // put a property | |
foo.z = 0 | |
foo?n // does foo have property n? | |
foo.n // lookup property n | |
def bar = {|| => [print("Hello Cleveland")]} | |
bar() // prints Hello Cleveland | |
bar.|| // returns the list `[print("Hello Cleveland")]` |
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
def foo = {} // start with an empty map | |
foo.n = 42 // put a property | |
foo.z = 0 | |
foo?n // does foo have property n? | |
foo.n // lookup property n | |
def bar = {|| => [print("Hello Cleveland")]} | |
bar() // prints Hello Cleveland | |
bar.|| // returns the list `[print("Hello Cleveland")]` |