[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

default values of flavor instance vars



    Date: Thu, 23 Feb 89 12:57 PST
    From: Martin@AI-SUN.JPL.NASA.GOV (Gaius Martin)
    
    Given this form:
    
    (defflavor foo
	    ((a 1)
	     (b 2)
	     (c 3))
	    ()
      :initable-instance-variables
      :writable-instance-variables
      :abstract-flavor)
    
    Is there a way to programmatically determine
    the default values for the instance variables of foo?

Here's some undocumented information which might be incompatible with a
future release.  However, it may be useful to you provided you realize it
only applies to 7.0 through 7.4 (and maybe some additional releases beyond
7.4, but maybe not).

(describe (flavor:find-flavor 'foo)) will show you a field that contains
the information you want.  The undocumented piece of information is that
flavor::flavor-xxx is the accessor for the xxx field shown there.  Thus
flavor::flavor-local-instance-variable-initializations.  The fields in the
result of flavor:find-flavor, except for the six that are documented, are
likely to change in some future release.

In CLOS you will access the same information through class-direct-slots
and slot-definition-initform (these names are still subject to change).