Ila (Gast)
| | The choice of whether to use WITH-SLOTS versus WITH-ACCESSORS is the same as the choice between SLOT-VALUE and an accessor function: low-level code that provides the basic functionality of a class may use SLOT-VALUE or WITH-SLOTS to directly manipulate slots in ways not supported by accessor functions or to explicitly avoid the effects of auxiliary methods that may have been defined on the accessor functions.
SLOT-VALUE takes an object and the name of a slot as arguments and returns the value of the named slot in the given object. But if you don't supply a :customer-name argument, the customer-name slot will be unbound, and an attempt to read it before you set it will signal an error.
Nginx has a concept of request processing time - time elapsed since the first bytes were read from the client. You can also use initforms that generate a different value each time they're evaluated--the initform is evaluated anew for each object. For now, however, you're ready to take a break from all this theory of object orientation and turn to the rather different topic of how to make good use of Common Lisp's powerful, but sometimes cryptic, FORMAT function. In Chapter 23 you'll see an example of how to define a method free bonus on registration - Rhys (https://dev.fuchs-press.com/%d1%8d%d0%ba%d0%b7%d0%b8%d1%81%d1%82%d0%b5%d0%bd%d1%86%d0%b8%d0%b0%d0%bb%d1%8c%d0%bd%d1%8b%d0%b9-%d0%b2%d1%8b%d0%b1%d0%be%d1%80/) - PRINT-OBJECT to make objects of a certain class be printed in a more informative form. |