A "package" is intended to be a larger collection of ooRexx code, such as one you'd use in a ::requires.  As such, when it is created, it runs the initialization section just as it would when pulled in using a ::requires.  If you wish to create a callable bit of code, you probably want the routine class. 

Rick

On Tue, Feb 12, 2013 at 5:51 PM, Staffan Tylen <staffan.tylen@gmail.com> wrote:
I'm fiddling with the .Package class and have found that if I create a new package from an array of rexx code, the new package is immediately executed by the init method. Is this the way it is supposed to work? Example:

a=.array~new
a~append("say 'hi this is me'")
a~append("say 'bye'")
p=.package~new("package1",a)

Also, if this is correct what's the purpose of the setSecurityManager method if the code has already executed? I'm probably far off track here but would be very grateful for a push in the right direction. Thanks for pushing.

Staffan


------------------------------------------------------------------------------
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb
_______________________________________________
Oorexx-users mailing list
Oorexx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-users