-
Notifications
You must be signed in to change notification settings - Fork 31
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
wishlist: allow @argcheck instead of @assert #34
Comments
Yes, that should be fine. I don't use ArgCheck.jl myself, but PR is welcome. |
There seems to be something brewing with |
The reason that blocks to insert julia> @macroexpand @argcheck 2 > 1
quote
$(Expr(:meta, :begin_optional, ArgCheck.LabelArgCheck()))
begin
var"#130###302" = (>)
var"#131###303" = 2
var"#132###304" = 1
if var"#130###302"(var"#131###303", var"#132###304")
ArgCheck.nothing
else
ArgCheck.throw(ArgCheck.build_error(ArgCheck.CallErrorInfo($(QuoteNode(:(2 > 1))), ArgCheck.ArgCheckFlavor(), $(QuoteNode(Any[:>, 2, 1])), [var"#130###302", var"#131###303", var"#132###304"], ())))
end
end
$(Expr(:meta, :end_optional, ArgCheck.LabelArgCheck()))
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Parameters.jl and ArgCheck.jl are two staple packages I always use for code. I like how
@argcheck
allows more meaningful error messages. I wonder if@with_kw
could also collect@argcheck
forms into the constructor, in addition to@assert
.The text was updated successfully, but these errors were encountered: