Rick McGuire - 2012-08-10

The package manager will not attempt to load a package more than once, so it is not an error for a program to refer to itself either directly or indirectly. Upon encountering the second reference, the loading second loading operation is terminated.

Note that in the case of the sample program provided, the main portion of this is run twice. This happens because this program is invoked as both a top-level program and also as a package via the ::requires. The top-level invocation does not involve the package manager, so the load operation invoked by ::requires will run the prolog portion of the package when it is loaded, then the prolog portion is run in the main program once the ::requires loading is complete.