9

Here's an approach to "automate" the usage of the ExpressionCleanup` paclet mentioned by @LeonidShifrin. The idea is to return an object from your module that contains two symbols: One for the actual downvalues (f), and one purely for keeping track of the reference count (marker). It is importan...