Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
[Spider]Swiftと似た?を使ったチェーンのメモ ref: http://qiita.com/iKichiemon/items/f240a89665f8e4ec4ce3
var name:String?
class Animal {
func name()->Void{
println("animal")
}
}
var animal:Animal?
animal = Animal()
animal?.name()
func Animal() {
this.name = () -> {
return "Dog"
}
}
var animal = new Animal()
animal.name()
var name = animal.name?() // "Dog"
var age = animal.age?() // undefined
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment