BioSequences.jl icon indicating copy to clipboard operation
BioSequences.jl copied to clipboard

Hide inner constructors of objects in this package

Open jakobnissen opened this issue 1 year ago • 1 comments

Right now you can do:

julia> LongDNA{4}(UInt[1], UInt(1))
1nt DNA Sequence:
A

This is not great, since it exposes the data layout of these objects to the user, and this is an implementation detail. For example, TwoBit.jl uses this. make an Internal struct and use it for the inner constructor.

However, this is breaking as this is a method of an exported type.

jakobnissen avatar Oct 21 '24 12:10 jakobnissen

Is this behavior documented? One could argue that it's not breaking if it's an internal representation and not documented, even if the method currently exists.

Then again, the fact that there's a package that uses it already is some argument against this.

kescobo avatar Oct 21 '24 19:10 kescobo