File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change 1111
1212function buildpolyvar (var)
1313 if isa (var, Symbol)
14- esc ( :($ var = PolyVar ($ " $var " ) ))
14+ :($ ( esc ( var)) = PolyVar ($ " $var " ))
1515 else
1616 isa (var, Expr) || error (" Expected $var to be a variable name" )
1717 Base. Meta. isexpr (var, :ref ) || error (" Expected $var to be of the form varname[idxset]" )
@@ -20,7 +20,7 @@ function buildpolyvar(var)
2020 varname = var. args[1 ]
2121 prefix = string (var. args[1 ])
2222 idxset = var. args[2 ]
23- esc ( :($ varname = polyvecvar ($ prefix, $ idxset) ))
23+ :($ ( esc ( varname)) = polyvecvar ($ prefix, $ idxset))
2424 end
2525end
2626
Original file line number Diff line number Diff line change @@ -15,3 +15,14 @@ facts("Vector to Monomial Vector") do
1515 @fact MonomialVector ([1 ]) --> MonomialVector (PolyVar[], [Int[]])
1616 @fact MonomialVector ([x]) --> MonomialVector ([x], [[1 ]])
1717end
18+ module newmodule
19+ using FactCheck
20+ import MultivariatePolynomials
21+ facts (" Polyvar macro hygiene" ) do
22+ # Verify that the @polyvar macro works when the package has been activated
23+ # with `import` instead of `using`.
24+ MultivariatePolynomials. @polyvar x y
25+ @fact isa (x, MultivariatePolynomials. PolyVar) --> true
26+ @fact isa (y, MultivariatePolynomials. PolyVar) --> true
27+ end
28+ end
You can’t perform that action at this time.
0 commit comments