Skip to content

[Dev] Export and conflicts #571

@ocots

Description

@ocots

Pour éviter les conflits si 2 modules possèdent les mêmes fonctions, on agrège :

julia> module A
       f(x::Int) = x
       end
Main.A

julia> module B
       f(x::Float64) = 2x
       end
Main.B

julia> module C
       import Main.A
       import Main.B
       f(x::Int) = A.f(x)
       f(x::Float64) = B.f(x)
       export f
       end
Main.C

julia> using .C

julia> f(1)
1

julia> f(1.0)
2.0

Metadata

Metadata

Assignees

Labels

internal devModification to the code is requested and should not affect user experiment

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions