Re: [tcljava-user] Restrict to change global variable value
Brought to you by:
mdejong
From: Patrick F. <fin...@gm...> - 2007-09-11 08:06:35
|
Try the OO extension incr. It has been ported to Jacl. "Each of the elements in a class can be declared "public", "protected" or "private". Public elements can be accessed by the class, by derived classes (other classes that inherit this class), and by external clients that use the class. Protected elements can be accessed by the class, and by derived classes. Private elements are only accessible in the class where they are defined. The "public" elements within a class define its interface to the external world. Public methods define the operations that can be used to manipulate an object. Public variables are recognized as configuration options by the "configure" and "cget" methods that are built into each class. The public interface says *what* an object will do but not *how* it will do it. Protected and private members, along with the bodies of class methods and procs, provide the implementation details. Insulating the application developer from these details leaves the class designer free to change them at any time, without warning, and without affecting programs that rely on the class.". http://wiki.tcl.tk/62 On 10/09/2007, mallick choppa <mal...@ya...> wrote: > > Hi > I have set a global variable in my interpreter. I have > extended few commands implementing tcl.lang.Command, > in which i access the global variable and and use the > value. > At the same time I have given provision for TCL > scripts loading through source command. In order to > access global variable , we have to specify global > <variable> in proc.. > > Any user can write proc command and load the script in > my system, in the proc command user can change the > value of global variable. Futher all my other command > will faile which are using this global variable. > > > How can I restrict the changing of global variable > which was set through programatically while > initializing the interpreter? > Any help , i will be very thankful. > > > regards > Mallick > > > > > > ____________________________________________________________________________________ > Building a website is a piece of cake. Yahoo! Small Business gives you all > the tools to get online. > http://smallbusiness.yahoo.com/webhosting > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2005. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > tcljava-user mailing list > tcl...@li... > https://lists.sourceforge.net/lists/listinfo/tcljava-user > |