FUNCTIONS, PROCEDURES AND PACKAGES
Acknowledgements Introduction
Functions and Procedures
Functions
Procedures
The forward Declaration
Packages
Introduction
Intrinsics
Resolving Calls to Intrinsics
Attaching and Detaching Package Files
Related Files
Importing Constants
Argument Checking
The Number of Results
Package Specification Files
User Startup Specification Files
Attributes
Predefined System Attributes
User-defined Attributes
Accessing Attributes
User-defined Verbose Flags
Examples
User-Defined Types
Declaring User-Defined Types
Creating an Object
Special Intrinsics Provided by the User
Examples
Introduction
Functions and Procedures
Functions
function
func
function
func
Example Func_Recursion (H2E1)
Example Func_Parameters (H2E2)
Example Func_Underscore (H2E3)
Example Func_Variadic (H2E4)
Procedures
procedure
proc
procedure
proc
Example Func_Procedures (H2E5)
The forward Declaration
forward f;
Example Func_forward (H2E6)
Packages
Introduction
Intrinsics
intrinsic
Example Func_intrinsic (H2E7)
Resolving Calls to Intrinsics
Example Func_intrinsic-lookup (H2E8)
Attaching and Detaching Package Files
Attach(F) : MonStgElt ->
Detach(F) : MonStgElt ->
freeze;
Related Files
Importing Constants
import "filename": ident_list;
Example Func_import (H2E9)
Argument Checking
require condition: print_args;
requirerange v, L, U;
requirege v, L;
Example Func_require (H2E10)
The Number of Results
NumberOfResults() : -> RngIntElt, [ BoolElt ]
Example Func_Nresults (H2E11)
Package Specification Files
AttachSpec(S) : MonStgElt ->
DetachSpec(S) : MonStgElt ->
Example Func_spec (H2E12)
User Startup Specification Files
Example Func_startup-spec (H2E13)
Attributes
Predefined System Attributes
User-defined Attributes
AddAttribute(C, F) : Cat, MonStgElt -> ;
declare attributes C: F1, ..., Fn;
Accessing Attributes
S`fieldname : Str, Fieldname -> Elt
assigned S`fieldname : Str, Fieldname -> BoolElt
S`fieldname := expression;
delete S`fieldname;
GetAttributes(C) : Cat -> [ MonStgElt ]
ListAttributes(C) : Cat ->
User-defined Verbose Flags
declare verbose F, m;
Examples
Example Func_SystemAttributes (H2E14)
Example Func_InteractiveUserAttributes (H2E15)
Example Func_PackageUserAttributes (H2E16)
User-Defined Types
Declaring User-Defined Types
declare type T;
declare type T: P1, ..., Pn;
declare type T[E];
declare type T[E]: P1, ..., Pn;
Creating an Object
New(T) : Type -> T
Clone(X) : Any -> Any
Special Intrinsics Provided by the User
Examples
Example Func_MyRat (H2E17)
Example Func_UserTypes2 (H2E18)
[Next][Prev] [Right] [____] [Up] [Index] [Root]
|