From: SourceForge.net <no...@so...> - 2012-08-10 00:07:37
|
Bugs item #3555749, was opened at 2012-08-09 08:47 Message generated for change (Comment added) made by bigrixx You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=684730&aid=3555749&group_id=119701 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Interpreter Group: 4.1.1 >Status: Closed >Resolution: Invalid Priority: 5 Private: No Submitted By: Rony G. Flatscher (orexx) Assigned to: Nobody/Anonymous (nobody) Summary: Requiring oneself should be an error ? Initial Comment: The following Rexx program should be saved under the name "test.rex". If executed, no runtime error is returned to inform the programmer that that program requires itself, which should be mostlikely an error ? --- cut here /* test.rex */ say "in test.rex ..." ::requires test.rex -- requiring oneself should be an error? ---------------------------------------------------------------------- >Comment By: Rick McGuire (bigrixx) Date: 2012-08-09 17:07 Message: 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. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=684730&aid=3555749&group_id=119701 |