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.
The fields and static-field functions
(see Accessing fields of Java objects) are easier to use, more powerful, and
just as efficient. However, the high-level functions currently do
not provide access to non-public fields.
Syntax: primitive-get-field class fname ftype
Use this to access a field named
fnamehaving typetypein classclass. Evaluates to a new one-argument procedure, whose argument is a reference to an object of the specifiedclass. Calling that procedure returns the value of the specified field.
Syntax: primitive-set-field class fname ftype
Use this to change a field named
fnamehaving typetypein classclass. Evaluates to a new two-argument procedure, whose first argument is a reference to an object of the specifiedclass, 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.)