Oh right, thanks! I forgot that works. I'd just used that like an hour ago
for strings.


On Fri, Sep 5, 2014 at 5:02 PM, John Myles White <[email protected]>
wrote:

> How do you feel about using Set( [(1, 2)] )?
>
>  — John
>
> On Sep 5, 2014, at 5:01 PM, Sam L <[email protected]> wrote:
>
> > I can't figure out how to make a set of tuples in a very clean way.
> >
> > This works:
> >
> > julia> push!(Set{(Int, Int)}(), (1,2))
> > Set{(Int64,Int64)}({(1,2)})
> >
> > but this doesn't:
> >
> > julia> Set((1,2))
> > Set{Int64}({2,1})
> >
> > because that calls Set{eltype(itr)}(itr).
> >
> > And this doesn't work:
> >
> > julia> Set{(Int, Int)}((1,2))
> > ERROR: `convert` has no method matching convert(::Type{(Int64,Int64)},
> ::Int64)
> >  in setindex! at dict.jl:545
> >  in union! at set.jl:23
> >  in Set at set.jl:5
> >
> > Any suggestions?
>
>

Reply via email to