Created
February 23, 2019 17:54
-
-
Save mrkaspa/bc7658af68ed38e53dd57881693e0e63 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
struct Solution | |
res::Union{Int64, Nothing} | |
end | |
function ex_div(a, b)::Solution | |
if b == 0 | |
Solution(nothing) | |
else | |
Solution(Int64(a / b)) | |
end | |
end | |
result = ex_div(10, 0) | |
if isnothing(result.res) | |
println("Nothing") | |
else | |
println(result.res) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment