How can I alias a macro?

I would like to use `@dot`

instead of `@.`

.

# Alias for a macro

**jw3126**#2

You could do

```
macro dot(expr)
:(@. $expr))
end
```

There is also the predefined alias `@__dot__`

.

**turtle**#4

Oops.

`@.`

seems to be more elaborate than the above definition of `@dot`

.

It also works for in-place assignments for which `@dot`

gives an error:

```
x = [0,1,2]
y = zeros(3)
@dot y = exp(x)
```

**turtle**#6

```
macro dot(expr)
esc(:(@. $expr))
end
```

- Is this correct?
- Is this the simplest way to alias a macro?

**yuyichao**#7

No. On 0.6 the correct and preferred way is `:(@. $(esc(expr)))`

, i.e. you must escape each input once and exactly once. On master this is broken so the only way you can do this is `esc(:($Base.@. $(esc(expr))))`

You can also just do `@eval const $(Symbol("@dot") = $(Symbol("@__dot__")))`

**turtle**#8

Thank you very much for the detailed explanation.

There was a small typo in parenthesizing, but the last version also works:

`@eval const $(Symbol("@dot")) = $(Symbol("@__dot__"))`