Re: Name space leakage

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


lasm.rm wrote:
> Long ago there was a discussion about name space leaking in script-fu. 
> Seems like variables and functions names in a script are visible 
> globally, causing potential name collision with other scripts out 
> there.
> Is this going to be the same with tiny-fu, or is there some 
> enhancement to contain the name within the script itself ?

The SIOD interpreter used in Script-Fu allows local variables to be accessed 
globally. The interepreter used in Tiny-Fu doesn't have that problem. Local 
variables are only accessible locally.

The current design of Script-Fu and Tiny-Fu is such that all available scripts 
are read in to memory when the plug-in starts. A public function defined in 
one file will be available to be called from any other file.

If two or more files contain public function(s) with the same name but 
different code, there will be a problem. The last version of a public function 
read in during startup will be the version of the function that will be seen 
by scripts at run time.

All functions defined in a file should be made private unless you know they 
will be needed by another script. This will prevent one script from breaking 
when a new script is added or another script is changed.


Kevin. |"What are we going to do today, Borg?"
Owner of Elecraft K2 #2172        |"Same thing we always do, Pinkutus:
                                   |  Try to assimilate the world!"
#include <disclaimer/favourite>   |              -Pinkutus & the Borg

------------------------ Yahoo! Groups Sponsor --------------------~--> 
Get Bzzzy! (real tools to help you find a job). Welcome to the Sweet Life.

Yahoo! Groups Links

<*> To visit your group on the web, go to:

<*> To unsubscribe from this group, send an email to:

<*> Your use of Yahoo! Groups is subject to:

[Index of Archives]     [Gimp Developers]     [Gimp Users]     [Yosemite News]     [Epson Inkjet Printers]     [Scanners]     [Gimp's Home]     [Steve's Art]

&hbsp; Powered by Linux