Copyright (C) 2000-2012 |
GNU Info (librep.info)DescriptionsDescriptions ------------ In this document the simplest type of descriptions are those defining variables (Note: Variables), they look something like: - Variable: grains-of-sand This imaginary variable contains the number of grains of sand in a one-mile long stretch of an averagely sandy beach. Hooks (Note: Hooks) are also described in this format, the only difference is that `Variable:' is replaced by `Hook:'. Functions (Note: Functions) and macros (Note: Macros) have more complex descriptions; as well as the name of the object being described, they also have a list of parameters which the object will accept. Each parameter in the list is named and may be referred to in the body of the description. Three keyword parameters may also be used: `#!optional', `#!key' and `#!rest'. They have the same meaning as when used in the lambda-list of a function definition (Note: Lambda Expressions). That is, `#!optional' means that all further parameters are optional, and `#!rest' means that the following parameter actually receives a list of any unused argument values. An example function definition follows. - Function: useless-function first `#!optional' second `#!rest' tail This function returns a list consisting of the values SECOND (when undefined the number 42 is used), all the items in the list TAIL and FIRST. (useless-function 'foo 'bar 'xyz 20) => (bar xyz 20 foo) (useless-function '50) => (42 50) Macros and interactive commands are defined in the same way with `Macro:' or `Command:' replacing `Function:'. Special forms (Note: Special Forms) are described similarly to functions except that the argument list is formatted differently, since special forms are, by definition, more flexible in how they treat their arguments. Optional values are enclosed in square brackets (`[OPTIONAL-ARG]') and three dots (`REPEATED-ARG...') indicate where zero or more arguments are allowed. automatically generated by info2www version 1.2.2.9 |