Skip to content
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

Guidelines for macros #49

Open
mattBrzezinski opened this issue May 7, 2020 · 1 comment
Open

Guidelines for macros #49

mattBrzezinski opened this issue May 7, 2020 · 1 comment

Comments

@mattBrzezinski
Copy link
Member

I'm currently working with AWSCore.jl and came across macro usage being over the line limit. I wasn't able to find a guideline for it here, so I figured I'd open it up to discussion.

Examples:

@delay_retry if e isa AWSException &&
    (http_status(e.cause) == TOO_MANY_REQUESTS || ecode(e) in throttling_error_codes)
end

@retry if e isa AWSException && (
    header(e.cause, "crc32body") == "x-amz-crc32" ||
    ecode(e) in ("BadDigest", "RequestTimeout", "RequestTimeoutException")
)
end

@retry if :message in fieldnames(typeof(e)) && occursin("Signature expired", e.message) end
@oxinabox
Copy link
Member

oxinabox commented May 8, 2020

related
I have seen @omus prefernetially use

(@foo a b c)

over

@foo(a, b, c)

which i think has some advantages when the body of macro becomes more complex

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants