But actually your point is a good one, and is one more argument for 
https://github.com/JuliaLang/julia/issues/1115
Over time more and more functions have been modified to have this type of 
interface, so certainly there is room for a
    find!(indexes, testf::Function, x)
function. `find` could then be written as
    find(testf::Function, x) = find!(Int[], testf, x)

Since this matters to you, care to prepare a pull request for this and any 
others that annoy you?

--Tim

On Sunday, July 13, 2014 11:38:46 AM J Luis wrote:
> Thanks. That's what I intend to do but I confess that I find the default to
> Int64 a bit annoying (for example when writing wrappers to C functions whre
> the Int(s) arguments are almost never Int64)
> 
> Domingo, 13 de Julho de 2014 10:50:12 UTC+1, Tim Holy escreveu:
> > If this really matters to you, check out the implementations of find in
> > base/array.jl. It's so short, you can trivially implement whatever
> > behavior
> > you want. For example, you could pass in an empty output array and have it
> > push! the indexes into it.
> > 
> > --Tim
> > 
> > On Saturday, July 12, 2014 12:43:29 PM J Luis wrote:
> > > > julia> find(x->x>5,a)
> > > > 
> > > > 5-element Array{Int64,1}:
> > > >   1
> > > >   2
> > > >   7
> > > >   8
> > > >  
> > > >  10
> > > 
> > > which very very sadly are Int64. When dealing with large matrices this
> > 
> > may
> > 
> > > lead to a large memory waste. These almost mandatory 64 bits issue is
> > 
> > one
> > 
> > > the things that annoyed me more in Matlab for many times it was the
> > > difference between having something work ... or not

Reply via email to