Hi, 

On Thursday, December 4, 2014 8:53:00 PM UTC+1, Steven G. Johnson wrote:
>
> help(findin) will tell you that the 2nd argument of findin should be a 
> collection, not a single element.  So you want findin(suo2, [a])
>

It is strange that for an array of Int Paul's approach works fine:

julia> findin([1, 4, 6], 4)
1-element Array{Int64,1}: 
2

julia> findin([1, 4, 6], 4) == findin([1, 4, 6], [4]) 
true


I think the current interpretation for an ASCIIString in terms of the 2nd 
argument in findin() is "the collection of characters"
julia> findin(['a', 'b', 'c'], "bc")
2-element Array{Int64,1}:
2
3

which may not be the intention of findin().  The reason, I believe, is the 
way the 2nd argument is cast into a set:
...
   bset = union!(Set(), b)
...

which seems to put most single element types in a Set, but for a string 
type this makes a set of the characters in the string. 

Reply via email to