Sponsored links: Algebra eBooks
 

Help Index

A

B

C

D

E

F

G

H

I

J

K

L

M

N

O

P

Q

R

S

T

U

V

W

X

Y

Z

The Maxima on-line user's manual

Algebra Calculator

Search:

Local Calculator

Local

Function: local (<v_1>, ..., <v_n>) Saves the properties associated with the symbols <v_1>, ..., <v_n>, removes any properties before evaluating other expressions, and restores any saved properties on exit from the block or other compound expression in which local appears.

Some declarations are implemented as properties of a symbol, including :=, array, dependencies, atvalue, matchdeclare, atomgrad, constant, nonscalar, assume, and some others. The effect of local is to make such declarations effective only within the block or other compound expression in which local appears; otherwise such declarations are global declarations.

local can only appear in block or in the body of a function definition or lambda expression, and only one occurrence is permitted in each.

local quotes its arguments. local returns done.

Example:

A local function definition.

          (%i1) foo (x) := 1 - x;
          (%o1)                    foo(x) := 1 - x
          (%i2) foo (100);
          (%o2)                         - 99
          (%i3) block (local (foo), foo (x) := 2 * x, foo (100));
          (%o3)                          200
          (%i4) foo (100);
          (%o4)                         - 99

(%o1)                                true
(%i2) 

Local Example

Related Examples