3.3 Type and Signature Declarations
signature_decl ::= "signature" method_name
"(" [arg_types] ")" [type_decl] ";"
arg_types ::= arg_type { "," arg_type }
arg_type ::= [[name] ":"] type
type_decl ::= ":" type
The names of formals in a signature are for documentation purposes only; they do not impact the meaning of the signature nor do they have any effect during type checking.Signatures can also be declared in a field-like notation, as follows:
field_sig_decl ::= ["var"] "field" "signature" method_name
"(" arg_type ")" [type_decl] ";"
A field signature declaration of the form
is syntactic sugar for the following two declarations:var fieldsignature name(type):typeR;
A field signature declaration does not require that implementations of the resulting signatures be fields, only that their interface "looks" like they could be implemented by fields. If thesignature name(type):typeR;signatureset_name(type,typeR):void;
var keyword is omitted, then the second set accessor signature is not generated.
Generated with Harlequin WebMaker