@scope directive

The @scope{x} directive defines a local scope for macro definitions. x is macro expanded as if no @scope directive was defined. This is useful for limiting the scope of macros, to avoid accidental invocation outside their intended usage.

Before translationAfter translation
@scope
{
    @def m(T) =
    {
        T min(T x1, T x2)
        {
            return x1 < x2 ? x1 : x2;
        }
    }
    m(int)
    m(double)
}
int m(1);

int min(int x1, int x2)
{
    return x1 < x2 ? x1 : x2;
}
double min(double x1, double x2)
{
    return x1 < x2 ? x1 : x2;
}
int m(1);