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

Try u_str without eval #161

Merged
merged 1 commit into from
Oct 15, 2018
Merged

Try u_str without eval #161

merged 1 commit into from
Oct 15, 2018

Conversation

tshort
Copy link
Contributor

@tshort tshort commented Sep 25, 2018

This is to help with precompiling (#133). It's generally frowned upon to use eval in a macro. This is an attempt to return the expression rather than evaling it. The main difference is that u"N*m" resolves to Unitful.N * Unitful.m whereas now, it resolves to the result of that multiplication.

Making u_str work with precompilation will make this macro useful in other packages (most other packages are going to want precompilation).

I tested this in a small package, and it does get rid of the eval warnings related to precompilation.

@codecov-io
Copy link

codecov-io commented Sep 25, 2018

Codecov Report

Merging #161 into master will decrease coverage by 0.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #161      +/-   ##
==========================================
- Coverage   97.53%   97.52%   -0.02%     
==========================================
  Files          15       15              
  Lines         689      686       -3     
==========================================
- Hits          672      669       -3     
  Misses         17       17
Impacted Files Coverage Δ
src/user.jl 97.11% <100%> (ø) ⬆️
src/units.jl 94.5% <0%> (-0.06%) ⬇️
src/quantities.jl 97.03% <0%> (-0.03%) ⬇️
src/range.jl 100% <0%> (ø) ⬆️
src/promotion.jl 100% <0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 71d5210...7bdf1df. Read the comment docs.

@ajkeller34 ajkeller34 merged commit 355aaba into PainterQubits:master Oct 15, 2018
@ajkeller34
Copy link
Collaborator

Sorry for the delay, I think this is a reasonable approach (I rebased and force pushed).

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

Successfully merging this pull request may close these issues.

3 participants