Last active
July 3, 2018 16:26
-
-
Save PavelGnatyuk/d459dbf74bb911dffa8e1107c2b3e554 to your computer and use it in GitHub Desktop.
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
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