The Art of the Metaobject Protocol- P4

The Art of the Metaobject Protocol- P4: The work described here is synthetic in nature, bringing together techniques and insights from several branches of computer. | Extending the Language 87 out in Chapter 1. The initialization form is inherited from the most specific slot that provides one and initialization arguments are computed by taking the union over all slots to be coalesced. a defgeneric compute-effective-slot-definition class direct-slots defmethod compute-effective-slot-definition class standard-class direct-slots let initer find-if-not null direct-slots key 1 slot-definition-initfunction make-effective-slot-definition name slot-definition-name car direct-slots initform if initer slot-definition-initform initer nil initfunction if initer slot-definition-initfunction initer nil initargs remove-duplicates mapappend slot-definition-initargs direct-slots User Code for the Slot Attributes Extension We can now present the user code required to implement the slot attributes extension. For the time being we are setting aside issues surrounding the extension of def class. We simply assume that the attributes slot option is properly handled and that its value is incorporated into the direct slot definition metaobject where it can be accessed with the function We will return to defclass as the subject of Exercise . As usual we begin by defining the new class metaobject class defclass attributes-class standard-class The proper inheritance of slot attributes and the storing of the value in each effective slot definition metaobject is provided by a specialized method on compute-effective-slot-def inition. 3 This function can be defined in a manner similar to the other slot definition metaobject accessors . slot-definition-initform 290 . 88 Chapter 3 defmethod compute-effective-slot-definition class attributes-class direct-slots let normal-slot call-next-method setf slot-definition-attributes normal-slot remove-duplicates mapappend slot-definition-attributes direct-slots normal-slot To hold the values of attributes storage is required in each instance over and above the storage needed to .

Không thể tạo bản xem trước, hãy bấm tải xuống
TÀI LIỆU MỚI ĐĂNG
5    57    1    27-04-2024
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.