Contents Previous Next Subchapters

Local Variable Functions
Syntax local function new function = existing function ( identifier list )
See Also arguments

Creates a new variable function with file scope .

Local variable functions are limited in scope to the file in which they are defined. If the file TEMP.OMS contains
     local function f = g(x)
     print f
and you enter the commands
     function g(x) begin
          return x
     function f() begin
          return 2
     x = 1
     include TEMP.OMS
O-Matrix will respond
because the function call f within the file TEMP.OMS returns the value of g(x), which is 1. If you continue by entering
     print f
O-Matrix will respond
because the function f within TEMP.OMS is no longer visible.

This syntax can only be used inside of a file (not at the command line).