Skip to content

Commit

Permalink
Restructure @varnames_interface inclusion
Browse files Browse the repository at this point in the history
  • Loading branch information
lgoettgens committed Sep 26, 2024
1 parent efb6ceb commit db07af9
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 11 deletions.
4 changes: 4 additions & 0 deletions src/AbsMSeries.jl
Original file line number Diff line number Diff line change
Expand Up @@ -215,3 +215,7 @@ when it was created.
function rand(S::MSeriesRing, term_range, v...)
rand(GLOBAL_RNG, S, term_range, v...)
end

@varnames_interface Generic.power_series_ring(R::Ring, prec::Int, s)
@varnames_interface Generic.power_series_ring(R::Ring, weights::Vector{Int}, prec::Int, s) macros=:no # use keyword `weights=...` instead
@varnames_interface Generic.power_series_ring(R::Ring, prec::Vector{Int}, s) n=:no macros=:no # `n` variant would clash with line above; macro would be the same as for `prec::Int`
2 changes: 1 addition & 1 deletion src/AbstractAlgebra.jl
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ const FieldElement = Union{FieldElem, Rational, AbstractFloat}
###############################################################################

include("fundamental_interface.jl")
include("misc/VarNames.jl")

################################################################################
#
Expand Down Expand Up @@ -344,7 +345,6 @@ end

include("misc/ProductIterator.jl")
include("misc/Evaluate.jl")
include("misc/VarNames.jl")

###############################################################################
#
Expand Down
2 changes: 2 additions & 0 deletions src/FreeAssociativeAlgebra.jl
Original file line number Diff line number Diff line change
Expand Up @@ -254,3 +254,5 @@ end
function rand(S::FreeAssociativeAlgebra, term_range, exp_bound, v...)
rand(GLOBAL_RNG, S, term_range, exp_bound, v...)
end

@varnames_interface Generic.free_associative_algebra(R::Ring, s)
2 changes: 2 additions & 0 deletions src/LaurentMPoly.jl
Original file line number Diff line number Diff line change
Expand Up @@ -158,3 +158,5 @@ For information about the many ways to specify `varnames...` refer to [`polynomi
specification in [`AbstractAlgebra.@varnames_interface`](@ref).
"""
laurent_polynomial_ring(R::Ring, s::Vector{Symbol})

@varnames_interface Generic.laurent_polynomial_ring(R::Ring, s)
2 changes: 2 additions & 0 deletions src/MPoly.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1428,6 +1428,8 @@ function polynomial_ring(R::Ring, s::Vector{Symbol}; kw...)
(S, gens(S))
end

@varnames_interface polynomial_ring(R::Ring, s)

"""
polynomial_ring(R::Ring, varnames...; cached=true, internal_ordering=:lex)
polynomial_ring(R::Ring, varnames::Tuple; cached=true, internal_ordering=:lex)
Expand Down
2 changes: 2 additions & 0 deletions src/RationalFunctionField.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@
function rational_function_field(k::Field, s::VarName; cached::Bool=true)
return Generic.rational_function_field(k, Symbol(s); cached=cached)
end

@varnames_interface Generic.rational_function_field(K::Field, s)
10 changes: 0 additions & 10 deletions src/misc/VarNames.jl
Original file line number Diff line number Diff line change
Expand Up @@ -474,13 +474,3 @@ macro varnames_interface(e::Expr, options::Expr...)
$(varnames_macro(d[:f], length(d[:argnames]), opts[:macros], opts[:n], opts[:range]))
end
end

@varnames_interface Generic.free_associative_algebra(R::Ring, s)
@varnames_interface Generic.laurent_polynomial_ring(R::Ring, s)
@varnames_interface Generic.rational_function_field(K::Field, s)

@varnames_interface Generic.power_series_ring(R::Ring, prec::Int, s)
@varnames_interface Generic.power_series_ring(R::Ring, weights::Vector{Int}, prec::Int, s) macros=:no # use keyword `weights=...` instead
@varnames_interface Generic.power_series_ring(R::Ring, prec::Vector{Int}, s) n=:no macros=:no # `n` variant would clash with line above; macro would be the same as for `prec::Int`

@varnames_interface polynomial_ring(R::Ring, s)

0 comments on commit db07af9

Please sign in to comment.