Package gnu.mapping
Class Location<T>
java.lang.Object
gnu.mapping.Location<T>
- Direct Known Subclasses:
ClassMemberLocation
,ConstrainedLocation
,IndirectableLocation
,ProcLocation
,PropertyLocation
A Location is an abstract cell/location/variable with a value of type T.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Location
Implement top-level 'define' for Scheme in interactive mode.boolean
entered()
True if directly entered in an Environment.abstract T
get()
Get the current value of this location.getBase()
final T
getValue()
abstract boolean
isBound()
boolean
static IndirectableLocation
static Location
static IndirectableLocation
void
print
(PrintWriter ps) abstract void
void
setRestore
(Object oldValue) Restore an old value.final T
setWithSave
(T newValue) Set a value, but return cookie so old value can be restored.toString()
void
undefine()
-
Field Details
-
UNBOUND
Magic value used to indicate there is no property binding.
-
-
Constructor Details
-
Location
public Location()
-
-
Method Details
-
getKeySymbol
-
getKeyProperty
-
toString
-
get
-
get
Get the current value of this location.- Throws:
UnboundLocationException
- the location does not have a value.
-
set
-
undefine
public void undefine() -
setWithSave
Set a value, but return cookie so old value can be restored. This is intended for fluid-let where (in the case of multiple threads) a simple save-restore isn't always the right thing. -
setRestore
Restore an old value.- Parameters:
oldValue
- the return value from a prior setWithSave.
-
isBound
public abstract boolean isBound() -
isConstant
public boolean isConstant() -
getBase
-
getValue
-
setValue
-
entered
public boolean entered()True if directly entered in an Environment. (Only if NamedLocation.) -
print
-
make
-
make
-
make
-
define
Implement top-level 'define' for Scheme in interactive mode. I.e. if there is no binding, create it; if the existing binding is non-constant, set its value; if it is constant, create a new binding initialized to the old value (though we actually change the binding to non-constant).
-