This is quite compact:
julia> a=IntSet([1:10])
IntSet([1, 2, 3, 4, 5, 6, 7, 8, 9, 10])
julia> [a...]
10-element Array{Int64,1}:
1
2
3
4
5
6
7
8
9
10
Note that you can add a convert method for it yourself, which would work
just as well as having one in Base. But of course maybe it should also
be added to Base but on that I have no opinion.
On Wed, 2015-02-04 at 20:19, Michael Wojnowicz <[email protected]> wrote:
> It appears to be possible to convert an array of integers to an IntSet,
> using for example a function of the form IntSet(IntegerArrayName), but it
> does not appear possible to back-convert, using a function of the form
> int(IntSetName) or convert(Array{Int64,1},IntSetName)
>
> The back-conversion would be useful for doing non-set theoretical
> mathematical functions, such as taking the median or mode.
>
> Of course it is not terribly hard to preallocate a vector of Integers and
> extract out the elements, but this starts to become (to my R and MATLAB
> trained sensibilities) a bit of a nuisance when e.g. dealing with arrays of
> IntSets in a more complicated algorithm.
>
> Would it be possible to add such a back conversion to the base package?
>
> -Mike
>