The .op operators actually generally do broadcast(op, ...) rather than map.
Now that higher order programming is really efficient on 0.5, we could
actually implement it that way too, which will eliminate some
implementation complexity.

On Tue, Apr 5, 2016 at 11:35 AM, Erik Schnetter <schnet...@gmail.com> wrote:

> On Tue, Apr 5, 2016 at 11:23 AM, Didier Verna <did...@didierverna.net>
> wrote:
> >
> >   I understand that some operators have elementwise versions, when
> >   prefixed with a dot. I think the manual is missing some dots, like in
> >   this paragraph, right ?
> >
> > "The operator < is intended for array objects; the operation A .< B is
> > valid only if A and B have the same dimensions. The operator returns an
> > array with boolean entries and with the same dimensions as A and B. Such
> > operators are called elementwise; Julia offers a suite of elementwise
> > operators: *, +, etc."
> >
> >   Also, is there a true mechanism for elementwise'ing operators ? Or are
> >   those just a collection of built-ins following the same naming
> >   convention ?
>
> The true mechanism is the `map` function. You could define
>
> ```Julia
> (.<)(arrays...) = map(.<, arrays...)
> ```
> (but the actual implementation might look different).
>
> -erik
>
> --
> Erik Schnetter <schnet...@gmail.com>
> http://www.perimeterinstitute.ca/personal/eschnetter/
>

Reply via email to