[julia-users] Re: issue with setdiff

2016-08-01 Thread Joris Bierkens
Thank you Tim, that works,

julia> setdiff(Set([1,2,3,4]),Set([2,3,5]))
Set([4,1])

has the expected behaviour, as well as

julia> setdiff(Set{Int}([1,2,3,4]),Set{Int}([2,3,5]))
Set([4,1])

On Monday, August 1, 2016 at 6:52:57 PM UTC+1, Tim Wheeler wrote:
>
> Your Set constructor is incorrect.
> Try Set{Int}([1,2,3,4]) instead.
>


[julia-users] issue with setdiff

2016-08-01 Thread Joris Bierkens
I a seemingly ok Julia installation, version 0.4.6 (2016-06-19 17:16 UTC), 
I try the command 

julia> setdiff(Set(1,2,3,4),Set(2,3,5))

and I get the following error:

ERROR: MethodError: `convert` has no method matching 
convert(::Type{Set{T}}, ::Int64, ::Int64, ::Int64, ::Int64)
This may have arisen from a call to the constructor Set{T}(...),
since type constructors fall back to convert methods.
Closest candidates are:
  Set(::Any)
  call{T}(::Type{T}, ::Any)
  convert{T}(::Type{T}, ::T)
  ...
 in call at essentials.jl:57

This is unexpected, especially since I have copied this line from this 
 tutorial.

Does somebody have any advise what is going wrong? Thanks, Joris