From: SourceForge.net <no...@so...> - 2003-08-23 16:27:24
|
Feature Requests item #793779, was opened at 2003-08-23 16:58 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=360894&aid=793779&group_id=10894 Category: 18. Commands M-Z Group: None Status: Open Resolution: None Priority: 5 Submitted By: Markus Elfring (elfring) Assigned to: Donal K. Fellows (dkf) Summary: Include source files only once Initial Comment: Multiple inclusion of source files can be avoided in compiled programming languages like C++ by preprocessor statements. ... #if !defined(_my_text_included) #include "my_text.h" #endif ... The TCL function "source" includes files, too. But there are no preprocessor directives in a scripting language like TCL. Their statements get executed every time. The language PHP provides the function "http://de.php.net/manual/en/function.include- once.php". I suggest to add the option "-once" to avoid multiple inclusions of TCL code. ... if {_my_text_included == 0} \ { source "my_text.h" } ... # Write just one line to achieve the same as before with more safety source -once "my_text.h" ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=360894&aid=793779&group_id=10894 |