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