index all rss twitter github linkedin email

Álvaro Ramírez

23 November 2018 Inline Swift computed properties

Via objc.io and Max Howell's retweet, TIL about Swift's inline computed properties. Another one to try on Org Babel. ‏

func greetWorld() {
 var message = "hello"
 var betterMessage: String {
   return "\(message) world"
 }
 print(betterMessage)
}

greetWorld()
hello world