12.07.2015 Views

spec - Local Sector 7 web page

spec - Local Sector 7 web page

spec - Local Sector 7 web page

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

at the end of the line.Within a macro the following substitutions are also made:$0 is replaced with the macro name,$* is replaced with all the arguments,$# is replaced with the number of arguments,$$ is a literal $.When a macro defined without arguments is invoked, only the macro name isreplaced with the definition. On the other hand, when a macro defined with argumentsis invoked, all characters on the input line up to a ; ,a{or the end of the lineare eaten up, whether or not the macro uses them as arguments.When numbered arguments are referred to in the macro definition, but are missingwhen the macro is invoked, they are replaced with zeros. If $∗ is used in the definitionand there are no arguments, no characters are substituted.As of <strong>spec</strong> release 3.03.10, there is no limit on the length of macro definitions.Macros can have a maximum of 25 arguments. The total combined size of all macrodefinitions is currently limited to 491,520 characters.Beware of unwanted side affects when referencing the same argument more thanonce. For example, if i++ is an argument referenced more than once in a macro definition,the result is probably not what was desired.MacroFunctionsMacro functions (introduced in release 4) are a type of macro that can return valuesand can be used as an operand in expressions. The macro definition can include functionarguments, which then become available to the body of the macro function. Forexample,def factorial(n) ’{if (n

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!