Instantly share code, notes, and snippets.

What would you like to do?
func goodMorning(morning: Bool, whom: @autoclosure () -> String) {
if morning {
print("Good morning, \(whom())")
func giveAname() -> String {
print("giveAname() is called")
return "Robert"
goodMorning(morning: true, whom: giveAname())
goodMorning(morning: true, whom: "Pavel")
goodMorning(morning: false, whom: "Jhon")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment