Aliases for `=` and `==`

That example is only worth it if it’s very succinct syntax, otherwise

macro stable(ex)
    Meta.isexpr(ex, :(=), 2) || throw(ArgumentError("`@stable` macro requires assignment."))
    quote
        tmp = $(esc(ex.args[2]))
        $(esc(ex.args[1]))::typeof(tmp) = tmp
    end
end

is easy enough to write.

I’d prefer not having syntax that (a) has no advantage over what someone can do in a library/with their own code (e.g. @stable vs stable), or is useless like := being an alias to =.

5 Likes