From RTSC-Pedia
[printable version] [offline version] | offline version generated on 02-Oct-2009 22:10 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.
[printable version] [offline version] | offline version generated on 02-Oct-2009 22:10 UTC |