Skip to content

CLOS Personal Notes

Ashok Khanna edited this page Dec 24, 2021 · 4 revisions

Use standard-class for version with slots

inherit from that

(name ...) -> Create Object

(expression ...) -> Access or Create? But if you do name-expression -> Then can access the slot

But then cannot access as (expression *) as in get expression regardless of *

So better to do make-expression -> More consistent.

So (defclass result () ())

(defclass standard-result (result) ((expression :accessor expression)))

make-result to create result

If slot is itself a class type, then name as (expression) if it is not, then call it result-expression.

If slot itself is a class type, then should inherit it vs. manually adding it in.

Inherit from slots when creating new objects that are similar from what you inherited from, vs. just putting the classes in the slots if you want them as components.