Since you know the name of the function, since it's also in the .xml file,
could you use another eval to get the local definition, and then assign it
to the appropriate global (maybe via eval again, or maybe it should go into
a dictionary object instead of a global variable), without modifying all the
.xml files?

David
----- Original Message -----
From: "Glenn Carr" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, October 07, 2002 10:56 AM
Subject: question


> I've run into a hitch while trying to move all the core script into
functions
> [1].  The problem is where the 'eval' function puts the results when
evaluating
> functions.  When they are done at global scope (as they are currently),
the
> functions are accessible in the global namespace.  When the eval is
performed in
> a function, the resulting functions are not visible globally.
>
> The solution I've come up so far is to parse the script as it is read in,
and
> modify the functions as such:
>
> gg = function _gg(...)
> { ... }
>
> This assigns a global variable (gg) to the local function, which allows
the
> local function to be referenced globally.
>
> In more ideas out there?
>
> Glenn
>
>
>
> [1] I'm moving the global code into function in order to be able to
> control/delay when the actual work is done when starting up the toolbar.
> Currently, a lot of script is executed when it is loaded simply because
its
> scope is global.



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
DQSD-Devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dqsd-devel

Reply via email to