silk
Class LocalVariable

java.lang.Object
silk.LocalVariable
- public class LocalVariable
- extends java.lang.Object
A LocalVariable is denoted by its position in the environment, in terms
of the number of levels "up" we have to go (number of nested environments),
the number of variables "in" we have to go (ordinal position of variable),
and whether the variable is a "rest" (or "dotted") variable.
Example of variables in (list x y z a b):
(lambda (x y) x.up=2, x.in=0 y.up=2, y.in=1
(lambda (z . a) z.up=1, z.in=0 a.up=1, a.in=1
(lambda b b.up=0, b.in=0
(list x y z a b))))
|
Field Summary |
int |
in
The ordinal position in the environment where the variable is. |
(package private) Symbol |
name
The name of the variable (for debugging purposes only). |
int |
up
The number of levels up in the parent chain where the variable is. |
|
Method Summary |
java.lang.String |
toString()
Use the name, up and in of the variable as its String
representation so they distinguish themselves from a Global
variable. |
up
public int up
- The number of levels up in the parent chain where the variable is.
in
public int in
- The ordinal position in the environment where the variable is.
name
Symbol name
- The name of the variable (for debugging purposes only).
LocalVariable
public LocalVariable(int up,
int in,
Symbol name)
- Create a new variable.
toString
public java.lang.String toString()
- Use the name, up and in of the variable as its String
representation so they distinguish themselves from a Global
variable.