#5 Instance slots access is not coherent

Annoyances (7)

As of version 1.0 of PyCLIPS, there are two functions to
access slots in an Instance objects, that is the
SlotValue ("getter") and PutSlot ("setter") methods. This
is not coherent with what happens with Fact objects for
instance, where a dict-like Slots attribute is provided,
giving access to fact slots both for assignment and
retrieval. Such a feature is desirable in Instance objects
as well, in order to have more readable and coherent

However, also the choosen names for the getter/setter
functions are not the best choice: they differ so much
that they look unrelated, so that code accessing
Instance slots results difficult to read. Thus, in every
case, it could be necessary to rename one of the
two "accessors" in a way that allows code to be more
coherent (e.g. PutSlot/GetSlot or

Current attributes should be retained at least until the
first stable release (1.1), then they can be deprecated
in 1.2 and eventually removed in a subsequent stable


  • Francesco Garosi

    • status: open --> open-fixed
  • Francesco Garosi

    Logged In: YES

    The names have been changed, and now the "official" names
    are GetSlot/PutSlot; also, the Slots dict-like property (as in
    the Fact class) has been added. However no deprecation
    warning is issued if slots are accessed via getter/setter
    functions. The old names have been retained (an extra
    SetSlotValue has been added as synonym for PutSlot just for
    coherence). Documentation has been updated accordingly.

  • Francesco Garosi

    • status: open-fixed --> closed-fixed

Log in to post a comment.