An object's slots are accessed using to functions: a getter and
a setter. By default, the getter function has the same name as the
slot, and the setter function appends “-setter
”. These functions may be invoked as follows:
owner(sample-vehicle); // returns owner
owner-setter("Faisal", sample-vehicle);
Dylan also provides some convenient “syntactic sugar” for these two functions. They may also be written as:
sample-vehicle.owner; // returns owner
sample-vehicle.owner := "Faisal";