I like that choice, personally.
--Tim
On Thursday, June 20, 2013 08:23:13 AM Dahua wrote:
> Please do not depend on the v-prefix function names such as vmap, vreduce,
> vsum yet.
>
> I am working on Plan (D) -- I am going to use the Base names such as map,
> reduce, and sum, etc and define such functions as extensions/specialized
> versions of the base functions. This makes it much easier and clean to use
> them.
>
> I expect to finish this change by today.
>
> On Thursday, June 20, 2013 8:11:23 AM UTC-5, Dahua wrote:
> > One of the reasons I created this is to prepare for migration to the Base.
> >
> > Before I invest efforts to making a pull request, I would like to have
> > some discussions here. One of the reasons I hesitate doing this is that
> > the
> > functors are no longer needed when inlining of function arguments is
> > implemented at the compiler part and we can obtain the return type of
> > functions programmatically (both are on the list of
> > #3440<
https://github.com/JuliaLang/julia/issues/3440>). However, I am not
> > sure how soon this may happen.
> >
> > Currently, there are four plans:
> >
> > (A) Start the migration now, which involves
> >
> > - Introduce the Functor class to the base -- so that user can define
> > its own functors
> > - Extend the map and map! function to accept functors
> > - Rewrite the reduction related function to do computation in a
> > cache-friendly way and accept functors as arguments
> >
> > (B) Start the migration, except that functors are used as an internal
> > facilities to support implementation instead of being exposed for general
> > use.
> >
> > (C) Wait until the aforementioned improvement happens, then do the
> >
> > migration in smaller scale:
> > - the functions like map and broadcast automatically gets much better
> > performance when functions are passed in
> > - still have to rewrite the reduction functions so that they perform
> > computation in a cache friendly order.
> > - still useful to add methods such as sum!(output, x, dim) to allow
> > writing the results of reduction along specific dimensions to a
> > pre-allocated storage
> >
> > (D) Currently, the functions in NumericFunctors.jl use prefix ``v`` to
> > avoid clash with base functions (e.g. vsum, vmax, vmap, vreduce, etc). I
> > tried to simply import the base functions and extend them to accept
> > functors, but run into various kinds of ambiguities (major reason being
> > that the function argument is declared as Any instead of Function). To
> >
> > address this, I can:
> > - Do some clean up of the declaration of relevant base functions (e.g.
> > ``map``, ``reduce``, ``sum``, etc), making them to be easier to extend
> > - rename the functions in NumericFunctors to those without v-prefix