Having read the issues (https://github.com/JuliaLang/julia/issues/4345), I think I have a better understanding of the complexity involved in importing functions of the same name. While I think some legitimate uses are eliminated if such imports are prohibited, the potential tripping points are probably too many and a clean solution may not have been possible..
Thinking about the two-methods problem for a while in fact led to the recognition of a better solution (re-factoring, and elimination of the duplicated method names). Thanks for your help, Petr On Friday, December 26, 2014 5:58:35 PM UTC-8, [email protected] wrote: > > IIUC import collisions are on name only, not by signature. > > From https://github.com/JuliaLang/julia/issues/4345 I understand that > this is because the two `distribloads` methods are methods of different > functions, one function defined in FEMMHeatDiffusionModule and one > in FEMMAcousticsModule. Its the functions that clash. The issues suggests > that combining the functions is hard/risky/brittle/error prone and in > general a bad idea (tm). > > Cheers > Lex > > On Saturday, December 27, 2014 5:27:31 AM UTC+10, Petr Krysl wrote: >> >> Here are two methods in two different modules: >> >> julia> methods(FEMMHeatDiffusionModule.distribloads) >> # 1 method for generic function "distribloads": >> >> distribloads(self::FEMMHeatDiffusion,assembler,geom::NodalField{Float64},temp::N >> odalField{Float64},fi::ForceIntensity{Float64},m::Int64) at >> C:\Users\pkrysl\Docu >> ments\GitHub\jfineale\./src/FEMMHeatDiffusionModule.jl:201 >> >> julia> methods(FEMMAcousticsModule.distribloads) >> # 1 method for generic function "distribloads": >> >> distribloads{T<:Number}(self::FEMMAcoustics,assembler,geom::NodalField{T<:Number >> },P::NodalField{T<:Number},fi::ForceIntensity{T<:Number},m::Int64) at >> C:\Users\p >> krysl\Documents\GitHub\jfineale\./src/FEMMAcousticsModule.jl:180 >> >> I cannot do "importall" on both modules at the same time: Julia complains >> about conflicting imports. >> I have a trouble making sense of that: The functions clearly have >> different signatures, so shouldn't the compiler be able to make sense of >> them? >> >> Any ideas? Thanks! >> >> Petr >> >> >>
