You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are $2^3 = 8$ possibilities. Refactor so these are clear.
Possibly create a function to assist.
A possible implementation is using Val. E.g.,
function foo(::Val{true}, x)
return x + 1
end
function foo(::Val{false}, x)
return x - 1
end
function foo(x)
if x > 0
return foo(Val(true), x)
else
return foo(Val(false), x)
end
end
The text was updated successfully, but these errors were encountered:
There are$2^3 = 8$ possibilities. Refactor so these are clear.
Possibly create a function to assist.
A possible implementation is using
Val
. E.g.,The text was updated successfully, but these errors were encountered: