Lugaru's Epsilon

Epsilon User's Manual and Reference
   Epsilon Extension Language
      . . .
      Order of Evaluation
         . . .
         Simple Binary Operators
         Assignment Operators
         Function Calls
         Miscellaneous Operators
      Constant Expressions
      . . .

Previous   Up    Next
Assignment Operators  Epsilon Extension Language   Miscellaneous Operators

Epsilon User's Manual and Reference > Epsilon Extension Language > Expressions >

Function Calls

        expression ()
        expression ( expression-list )

        expression , expression-list

An expression followed by a parenthesized list of expressions (arguments) is a function call. Usually the first expression is the name of a function, but it can also be an expression yielding a function. (The only operator that yields a function is the unary * when applied to a function pointer.) The type of the result is the type of the returned value. If the function returns no value, the expression must appear in a place where its value is not used. You may call any function recursively.

If an identifier that has not been previously declared appears as the name of the function, it is implicitly declared to be a function returning an int.

Each argument is evaluated and a copy of its value is passed to the function. Character and short arguments are converted to ints in the process. Aside from this, the number and type of arguments must match the definition of the function. The order of evaluation of the arguments to a function is undefined.

Since only a copy of each parameter is passed to the function, a simple variable cannot be altered if its name only appears as the argument to a function. To alter a variable, pass a pointer to it, and have the function modify the object pointed to. Since an array is converted to a pointer whenever its name occurs, an array that is passed to a function can indeed be altered by the function. Numbers, spots, and pointers may be parameters, but structures, unions, or functions cannot be. Pointers to such things are allowed, of course.

An EEL function can call not just other EEL functions, but also any of Epsilon's built-in functions, known as primitives. These are listed in the next chapter. An EEL function can also call a keyboard macro as a function. The word "function" refers to any of the various types of routines that a command written in EEL can call. These include other commands or subroutines (themselves written in EEL), primitives that are built into Epsilon and cannot be changed, and keyboard macros (see Keyboard Macros). Textual macros that are defined with the #define preprocessor statement are not functions.

Each function may require a certain number of arguments and may return a value of a particular type. Keyboard macros, however, never take arguments or return a value.

Previous   Up    Next
Assignment Operators  Epsilon Extension Language   Miscellaneous Operators

Lugaru Copyright (C) 1984, 2016 Lugaru Software Ltd. All Rights Reserved.