[julia-users] Type of composite type

2016-01-21 Thread pevnak
Hello, I have a problem to which I have found a dirty solution and I am keen to know, if there is a principal one. I have a composite type defined as type Outer{T} A::T B::T end where A and and B are composite types Then I want to create constructor function Outer(k::Int)

Re: [julia-users] Type of composite type

2016-01-21 Thread Mauro
Maybe you can adapt this: julia> type Outer{T} A::T B::T end julia> Outer{TT}(a::TT, b::TT) = Outer{TT}(a,b) Outer{T} ## the first {TT} is a function type parameter whereas the second {TT} ## is the type parameter! Very confusing julia> Outer(5,6)

Re: [julia-users] Type of composite type

2016-01-21 Thread Yichao Yu
On Thu, Jan 21, 2016 at 9:23 AM, wrote: > Hello, > I have a problem to which I have found a dirty solution and I am keen to > know, if there is a principal one. > > I have a composite type defined as > > type Outer{T} > A::T > B::T > end > > where A and and B are