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.

-- 
Cheers!

Kevin.

http://www.interlog.com/~kcozens/ |"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.
http://us.click.yahoo.com/A77XvD/vlQLAA/TtwFAA/e4wwlB/TM
--------------------------------------------------------------------~-> 

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/script-fu/

<*> To unsubscribe from this group, send an email to:
    script-fu-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 




Photo 4 Less

[Gimp Developers]     [Gimp Users]     [Photos]     [Yosemite News]     [Yosemite Photos]    [Epson Inkjet]     [Scanner]     [Gimp's Home]     [Steve's Art]

Add to Google Powered by Linux