Created
July 3, 2018 16:11
-
-
Save PavelGnatyuk/893cf81b11766fb22a9bf0a929e4172a to your computer and use it in GitHub Desktop.
This file contains hidden or 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 assert(_ condition: @autoclosure () -> Bool, _ message: @autoclosure () -> String) { | |
if condition() { | |
print(message()) | |
} | |
} | |
func conditionOne() -> Bool { | |
return true | |
} | |
func phrase() -> String { | |
return "Text" | |
} | |
assert(true, "Hello") | |
assert(false, "Good bye") | |
assert(conditionOne(), phrase()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment