Alias for a macro

Despite this old thread, perhaps it deserves to mention that a more convenient way is to use the var"name" syntax introduced in Julia 1.3.

julia> var"@myassert" = var"@assert";
julia> @myassert 1 + 1 == 3 "wrong equation"
ERROR: AssertionError: wrong equation

See here and this Stackoverflow for details.

5 Likes