Then Cyrus decided he wanted to support weak references. A weak reference is one that the GC can decide to release if there are no other references to it.
For our LazyLoader, that would mean that you create the item when demand appears, and it may go away if it’s not needed, and then it’ll come back later if needed again. At that point, you really do have a cache.
To do this, Cyrus first built some cool classes to handle weak and strong references. You could think of IStrongReferenceas being the same as a regular reference in C# today.
Note that you can have a strong or weak reference to ‘null’, and that’s not the same thing has not having a reference as all. ‘null’ is a value, and None<> is not a value. Ahh, the power of IOptional<>.
One other thing Cyrus mentioned is that he might put these in a References namespace, and refer to them with FQNs:
That reads well, but C# wasn’t really built for it, IMO. A question of style, I guess.