The following macros evaluate to procedures that can be used to access or change the fields of objects or static fields. The compiler can inline each to a single bytecode instruction (not counting type conversion).
These macros are deprecated.
(see Accessing object fields) are easier to use, more powerful, and
just as efficient. However, the high-level functions currently do
not provide access to non-public fields.
Use this to access a field named
class. Evaluates to a new one-argument procedure, whose argument is a reference to an object of the specified
class. Calling that procedure returns the value of the specified field.
Use this to change a field named
class. Evaluates to a new two-argument procedure, whose first argument is a reference to an object of the specified
class, and the second argument is the new value. Calling that procedure sets the field to the specified value. (This macro's name does not end in a ‘
!’, because it does not actually set the field. Rather, it returns a function for setting the field.)
primitive-get-field, but used to access static fields. Returns a zero-argument function, which when called returns the value of the static field.