Aztec® Programming Language

Version 1.0 Alpha

Copyright © 2010-2013

Cold Spring® Development Group

All Rights Reserved

Download Aztec

Site Help

♦ Syntax

Aztec Method Definition Syntax

 

♦ Where ‘Type’ is a valid class (primitive data type - value or reference, or a Class reference), and the type is optional.

♦ If data type is not provided, the method does not return anything, and thus can not be used within an expression. It can be called via the "Method Call" statement.

♦ Parentheses on the method name are also optional if the method has no arguments.

♦ Arg List Syntax

♦ “(Type1 Arg1,Type2 Arg2, etc.)”

♦ Default values for arguments can be specified (e.g. “MethodName(int  Value1 = 100,int  Value2 = 200)”  ).

♦ If an argument has a default value, all arguments after that must use a default too.

♦ Keywords supported by the method definition statement

Method Definition Keywords

 

♦ Primitive method arguments can be passed as values or references (using ’@’).

♦ Methods can be defined at the following scope levels

♦ Global – defined outside of a class. Visibility can be well controlled to the module, space and unit, and any combination of them. Default visibility is ‘unit’ and default space is ‘aztec.script’.

♦ Class – defined within a class. Can be instance method (access to instance data for each instance of the class), or can be shared (no access to instance data, but has access to shared data for the class). Much flexibility controlling visibility of method, with a default visibility of ‘unit’.

♦ Method names can be overloaded with different argument lists, and the compiler automatically determines which is appropriate.

♦ The combination of method name and argument list (signature) must be unique within the scope where it is defined. Note that default arguments also play into this analysis.

♦ If defined inside a class, the signature must be unique within class that class (and base classes depending on visibility settings).

♦ If defined outside a class, signature must be unique within the global scope, depending on visibility settings.

♦ If the 'unique' keyword is used, the name can not be overloaded within the scope where it is defined. The name itself must be unique amongst all methods within that scope.

♦ If 'unique', the method can be passed as a "method reference" argument in a method call. This is useful for registering event handlers.

♦ Some example code snippets showing Aztec method definitions

Method Definition Examples

 

Page UpPage DownCopyright © 2010-2013
Cold Spring Development Group
All Rights Reserved

Download Aztec