[previous] [up] [next]     [contents] [index]
Next: Parameters Up: xctocc Syntax Previous: Commands

Function and Method Declarations

The general syntax for a function declaration is:

@ [mark-char] "Scheme-name" : return C++-name(param, ...)[;] [: inserts] [<> casename] [## ifdefname]

mark-char (after translation by any relevant @SETMARK @SETMARK commands) can be:

Any other value of mark-char is ignored.

return is just like param (see below), except that it cannot have a default value, and has no use for a typecheck function (it is implicit in the unbundling) or comparison type (so those fields are omitted).

Multiple @ statements can be given for the same C++-name to make multiple versions of an overloaded function available from Scheme. The number or types of Scheme parameters must be different for each version of the overloaded function. The casename field is used in this case to build sensible error messages when illegal parameter types are provided.

Constructor declarations have a simplified form:

@CREATOR @CREATOR (param, ...)[;] [: inserts] [<> casename] [## ifdefname]





PLT