-
Notifications
You must be signed in to change notification settings - Fork 1
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
overhaul to allow for different labels #8
Conversation
0a696be
to
0860aa2
Compare
0860aa2
to
6b88418
Compare
Codecov Report
@@ Coverage Diff @@
## master #8 +/- ##
=====================================
Coverage 100% 100%
=====================================
Files 1 1
Lines 26 29 +3
=====================================
+ Hits 26 29 +3
Continue to review full report at Codecov.
|
end | ||
|
||
@dynamo function skipargcheck(x...) | ||
struct ElideCheck{label} | ||
ElideCheck(label::Symbol) = new{label}() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any particular reason, why label
is not a field, but a type parameter?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I need to do some benchmarks, whether there is actually any difference
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just for my understanding. You are talking about compile time performance, not run time right? Because as I understand it at run time no ElideCheck
objects exist anymore.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, now that I've looked into this, a type parameter is definitely the way to do this. A @dynamo
cannot access any fields of ElideCheck
, so the only way to access the label would be to insert a statement into the IR
, which wouldn't even work in this case. This makes sense, if you think about it, because otherwise IRTools
would have to recompile f
every time, since label
is not a compile time constant.
julia> using ArgCheck, OptionalArgChecks
[ Info: Precompiling OptionalArgChecks [dfbeeb84-381a-44da-9ec9-a723abf299c7]
julia> f(x) = @argcheck x > 0
f (generic function with 1 method)
julia> @skipargcheck f(-1)
julia> 👍 |
I registered an ArgCheck version that has markers: |
Co-Authored-By: Jan Weidner <[email protected]>
992b99a
to
2b87444
Compare
Great! @simeonschaub what do you think about tagging a release? |
Already done: JuliaRegistries/General#9359. Still waiting for 0.1 to be registered though:grin: |
Ref: #7, jw3126/ArgCheck.jl#32