Sorry for the bother-

I just resolved the issue like this-

import Base.push!
typealias Corpus Array{Int,1}
corpus = Int[]::Corpus
push!(corpus,1)
push!(corpus,2)
@assert typeof(corpus) == Corpus
@assert typeof(corpus) == Array{Int,1}

Thanks,
Krishna




On Saturday, May 2, 2015 at 2:40:16 PM UTC-4, Krishna Subramanian wrote:
>
> I would like to know how to do something like this-
> typealias Corpus Array{Int,1}
>
> and write a constructor for it. Currently, if I do -
>
> Corpus() = Array(Int,0)
>
> I get-
>
> ERROR: cannot define function Corpus; it already has a value
>
> I am sure others have encountered this problem before. I went through 
> https://github.com/JuliaLang/julia/issues/1470 but I am still not able to 
> figure out what is the issue involved. 
>
> Thanks,
> Krishna
>

Reply via email to