#$

IMPORT #$;

IMPORT symbol-list FROM #$;

#$.module

The #$ module reference identifies the module and package in which the current MACRO or FUNCTIONMACRO was defined. It is useful when a macro imports or references definitions that belong to its defining module, regardless of the module from which the macro is called. This prevents those references from being resolved relative to the call site.

Within a macro, #$ can be used as an import source or as the beginning of a qualified module reference:

EXPORT showValue() := MACRO
    IMPORT #$;
    OUTPUT(#$.value);
ENDMACRO;

EXPORT showChildValue() := MACRO
    IMPORT childModule FROM #$;
    OUTPUT(childModule.value);
ENDMACRO;

The #$ reference also preserves the package context of a macro. The caret can be used to navigate from that context, for example:

EXPORT formatValue(input) := FUNCTIONMACRO
    IMPORT #$.^.format AS formatter;
    RETURN formatter.formatValue(input);
ENDMACRO;

Use $ for the current module or folder, and append ^ to a module specifier to navigate to its container. The #$ reference is specifically for retaining the macro's defining module and package context during expansion.