Created
September 6, 2015 04:36
-
-
Save patzearfoss/3cadc3090759306f2028 to your computer and use it in GitHub Desktop.
Shows some funky(func-y) stuff in swift
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
//: Playground - noun: a place where people can play | |
import UIKit | |
var f_var: () -> String = { | |
return "Wat" | |
} | |
let f1: () -> String = { | |
return "Indubitably" | |
} | |
let f2: () -> String = { | |
return "Sure, why not?" | |
} | |
f_var = f1 | |
print (f_var()) | |
// ============= | |
func g() -> String { | |
return "gee" | |
} | |
print (g()) | |
var s = "the letter s" | |
func capture_g() -> String { | |
return s | |
} | |
capture_g() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment