| Function Arguments |
|
The rules of construction and terminology of a computer programming language. These rules are analogous to rules of spelling and grammar in a language, except these rules are usually less forgiving. We can read a thousand-page book that has one error in spelling or grammar. Such is not the case with a computer program because it will not usually run if there is a syntax error. Syntax applies to functions and the way functions are used in program expressions. The syntax describes the form that the program expression must take when it uses that function. Syntax can also be thought of as the rules for writing a program expression, or the structure of a program expression. Here, for example, is the syntax of the substr (substring) function: {This function takes three arguments in the following form: (substr argument1 argument2 argument3). Argument1 is a string. Argument2 is an integer indicating how far into the string to begin extracting the substring. Argument3 is optional and is an integer indicating how long the substring will be.} By describing what arguments are used with the function, the order of the arguments, and how those arguments work, we have described the function's syntax. |