Julia: Warning after workspace

Created on 6 Aug 2014  路  7Comments  路  Source: JuliaLang/julia

When using the new workspace() functionality while testing my 'TensorToolbox.jl' package (under active development), I get the following warning:

using TensorToolbox
workspace()
using TensorToolbox
Warning: Method definition ^(Type{Real},Int64) in module TensorToolbox at /Users/jhaegemn/.julia/v0.3/TensorToolbox/src/spaces/cartesianspace.jl:13 overwritten in module TensorToolbox at /Users/jhaegemn/.julia/v0.3/TensorToolbox/src/spaces/cartesianspace.jl:13.
Warning: Method definition ^(Type{Complex{Real}},Int64) in module TensorToolbox at /Users/jhaegemn/.julia/v0.3/TensorToolbox/src/spaces/complexspace.jl:14 overwritten in module TensorToolbox at /Users/jhaegemn/.julia/v0.3/TensorToolbox/src/spaces/complexspace.jl:14.

I don't think this is supposed to happen, since clearly I overload a lot of methods and operators, so it is very strange that only this specific case gives a warning. I can give more details if required, but don't know which information is relevant. (I can also explain why I want to define ^ for a type and an Int if anybody would be interested :-) ).

All 7 comments

It is just warning because the definitions from the old version of the module are being exactly overwritten by new ones.
I kind of like Real^3 == (Real,Real,Real) :)

I don't fully understand. There are many definitions that are being overwritten, basically every definition in my package is exactly overwritten if I reload the package after workspace(). Why is this case special?

Definitions that involve types from the package are not being overwritten. Reloading the package creates a new instance of the type, and methods involving the new instance do not overwrite methods involving the old instance. I suspect this case is special because the definitions involve only types from Base, which do not change after workspace() (unless you have more definitions involving only types from Base which aren't producing warnings).

Thanks for the clear explanation. That indeed makes sense. I guess this will indeed be the only definitions not involving any custom type.

PS: Real^3 is actually a shorthand for creating a CartesianSpace(3), a subtype of VectorSpace. There is also the unicode equivalent 鈩漗3 , which unfortunately is not yet easy to get in Julia. I am looking forward to a PR that closes #7657 .

After reading the previous discussion, I roughly understand why these "definitions overwritten by themselves" warnings are generated, but how do we fix (or eliminate) them in general?

Having a long list of these warnings every time after workspace() is pretty annoying.

@wsshin Indeed!

They are not there by default on 0.7.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

helgee picture helgee  路  3Comments

yurivish picture yurivish  路  3Comments

sbromberger picture sbromberger  路  3Comments

i-apellaniz picture i-apellaniz  路  3Comments

dpsanders picture dpsanders  路  3Comments