Re: [julia-users] Invalid redefinition when redefining an identical parameterized type

2016-02-11 Thread Kristoffer Carlsson
Ah, that's a good idea! Thanks! On Thursday, February 11, 2016 at 6:32:06 PM UTC+1, Stefan Karpinski wrote: > > You could also make the type definition conditional and only evaluate it > if it isn't already defined. > > On Thu, Feb 11, 2016 at 12:21 PM, Kristoffer Carlsson > wrote: > >> Modules

Re: [julia-users] Invalid redefinition when redefining an identical parameterized type

2016-02-11 Thread Stefan Karpinski
You could also make the type definition conditional and only evaluate it if it isn't already defined. On Thu, Feb 11, 2016 at 12:21 PM, Kristoffer Carlsson wrote: > Modules might work but they bring other annoyances... I would be fine with > a warning and just ignoring the whole type block. > >

Re: [julia-users] Invalid redefinition when redefining an identical parameterized type

2016-02-11 Thread Kristoffer Carlsson
Modules might work but they bring other annoyances... I would be fine with a warning and just ignoring the whole type block. Similar to: julia> const a = 1 1 julia> const a = 2 WARNING: redefining constant a 2 couldn't it be: julia> type Foo2{T} a::T end julia> type Foo2{T}

Re: [julia-users] Invalid redefinition when redefining an identical parameterized type

2016-02-11 Thread Stefan Karpinski
Defining types in a module and then reloading the module helps. The bindings get messy though, so it's best to qualify all accesses when you're developing like that. This is kind of an annoyance – not sure how hard it would be to fix but it should be doable. On Thu, Feb 11, 2016 at 12:10 PM, Krist

[julia-users] Invalid redefinition when redefining an identical parameterized type

2016-02-11 Thread Kristoffer Carlsson
I have a file that defines a type and a few functions. Sometimes I want to reload this file in the REPL to update some modified functions in the file. If the type is parameterized then this will fail even though the type definition does not change. Example: julia> type Foo a::Int