So I need to find position of a certain type member in a type. Easy, I 
though

julia> fn = fieldnames(GMT_PALETTE)
9-element Array{Symbol,1}:
 :n_headers
 :n_colors
 :alloc_level
 :auto_scale
 :model
 :is_gray
 :is_bw
 :is_continuous
 :z_unit_to_meter

julia> search(fn,"is_continuous")
ERROR: MethodError: `search` has no method matching 
search(::Array{Symbol,1}, ::ASCIIString)
Closest candidates are:
  search(::AbstractString, ::AbstractString)
  search(::AbstractString, ::AbstractString, ::Integer)

Went to the docs and found the "symbol" function and though, ok now it will 
work 

julia> search(fn,symbol("is_continuous"))
ERROR: MethodError: `search` has no method matching 
search(::Array{Symbol,1}, ::Symbol)

Ok, I can do a loop over the number of elements and ask

    fn[k] == symbol("is_continuous")

but isn't there a more compact way of do this ? 

(I confess this parts of Julia are annoying)

Thanks

Reply via email to