Use condition result inside conditional

The following works:

foo() = 3

if !isnothing(begin x = foo() end)
    println(x)
end

To be honest I’d probably stick with using !== for readability. It’s not really important either way.

3 Likes