-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@something
: a short-circuiting something
#40729
Conversation
I'll add a NEWS entry tomorrow |
Nice! Would it make sence to also have |
That can definitely be added. I just didn't have a use case for it |
|
CI failure is from the LibCURL stdlib and is unrelated |
Ah, I forgot to mention that these should have a compat annotation in the docstrings. |
I'll take care of that now |
371: Use external `@something` r=mattBrzezinski a=omus Replaces the definition of `@something` with the one [from base](JuliaLang/julia#40729) or [from Compat.jl](JuliaLang/Compat.jl#742). Co-authored-by: Curtis Vogt <[email protected]>
* Create `@something` * Create `@coalesce` * Correction to `something`/`coalesce` docstring
* Create `@something` * Create `@coalesce` * Correction to `something`/`coalesce` docstring
In the AWS.jl package I was noticing a pattern where if an argument was undefined a series of fallbacks would be tried. The code was similar to:
Since the code above makes use of
nothing
using thesomething
function is a natural fit:This is much easier to read but unfortunately evaluates all arguments even if they aren't used. The
@something
macro is equivalent tosomething
but skips evaluating all argument after the first non-nothing
value.