Product Site

5.1.5.4. addPackage

Adds the package object package to the dependent packages. An optional string namespace may be specified, which will allow to qualify references to classes or routines within package.

The added package is processed as if it had been added using a ::REQUIRES directive in the original package source.

Example 5.39. Package class — addPackage method
.context~package~addPackage(.Package~new('winsystm.cls'), 'windows')
say windows:virtualkeycodes~new~keyName(36)   -- HOME