From RTSC-Pedia

Jump to: navigation, search
revision tip
—— LANDSCAPE orientation
[printable version]  [offline version]offline version generated on 04-Aug-2010 21:08 UTC

XDCscript - Module-Body

The implementation of a module

A module body is a capsule that implements all (inherited) module-wide and per-instance metaonly functions declared in a module's unit-specification. These capsule files are named ModName.xs, where ModName is the name of the module without the package prefix, and reside in the base directory of the containing package. A special capsule named package.xs implements the (module-wide) functions specified in the xdc.IPackage interface.

 
 
 
 
function fxnName(arg ... ) {  // Typed-Assignment of callee's values to this function's params
    this.$private.foo = ...;  // 'this' references the appropriate module or instance object
    return (expr)             // Typed-Assignment of expr to a return of a typed value
}

The preceding fragment implements a module-wide or per-instance function specified for this module. The keyword this references the corresponding Module or Instance object, whose $private state is manipulated in this capsule. Typed-Assignment rules are enforced upon function entry and exit.

See also

XDCscript - Module-Object.$private Private state object of the module

[printable version]  [offline version]offline version generated on 04-Aug-2010 21:08 UTC
Copyright © 2008 The Eclipse Foundation. All Rights Reserved


Views
Personal tools
package reference