Don't. :-)  "Floating code" I take to mean globals, generally this is 
poor design in a library. If the code that "floats" is used by the 
functions then pass the function the values, or encapsulate (there's 
that OOP word) somehow. If its code specific to a particular function 
then embed it in the function.  The one exception of course would be 
class attributes, but then they should be made to only be accessible 
from within the classes' name space.

If you only want particular functions you are probably better off 
pulling that function(s) out and putting it into its own library, then 
use or require from the first library into the second library, which 
means you only have 1 copy, but now you can access it without the 
floaties in your script, while only needing one small modification to 
the library it originally lived in.

You might also try putting package identifiers around the code in which 
case when you use a package that has a different name space than the 
package with the floaties they probably won't be executed, but this is 
where I defer to the experts.................

http://danconia.org

keren wrote:
> Hi,
> 
> I have a set of functions in a file, which I want to use in my code.
> there is also some floating code in that file (code that is written in the file body 
>with no functions or classes).
> is there a way I can use the functions in the file without running the floating code 
>(the floating code is activated as soon as I 'use' the file).
> 
> Thanks,
> Keren.
> 



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to