Mathematica: Webel ADT pseudo classes: POLICY: The expression '$$' is reserved as the primary named parameter for the defining pattern of all ADT classes that extend the universal base 'ADT' class.

Webel IT Australia promotes the amazing Mathematica tool and the powerful Wolfram Language and offers professional Mathematica services for computational computing and data analysis. Our Mathematica tips, issue tracking, and wishlist is offered here most constructively to help improve the tool and language and support the Mathematica user community.
DISCLAIMER: Wolfram Research does not officially endorse analysis by Webel IT Australia.
Icon class
icon_class
far fa-sticky-note
icon_class_computed
far fa-sticky-note
Note kind
Policy level
Webel Mathematica keywords
Keywords
Example:
ADT$Map[$$_Association]
ADT$Map /: get[$$_Association] := $$;

In the Webel recipe for ADTs this is actually inherited from a base ADT and uses a variable 'pattern' as a template that is passed to a definer function:

ADT /: get[pattern] := $$;

So in the above case pattern would be $$_Associaton.

This policy offers a clearly identified variable expression that is not likely to otherwise be used in code (unless deliberately) and helps avoid this possible clash:

However, to make the Webel ADT recipe work when referenced from OTHER packages, you need this:

Beware also that the special ADT⊙get accessor BREAKS ENCAPSULATION:

Relates to
Related notes
Related notes (backlinks)
Related snippets (extracts)
Visit also
Visit also (backlinks)