CM: formatting-slots vs. (defobject .. :parameters)

Larry Troxler lt@westnet.com
Fri, 25 Jul 1997 21:42:40 -0400


I am currently looking through the CM code, to try to figure out how to
implement my idea of an object that when run, will use its slots as
parameters to a function call, that will, when scheduled, call this
function which will typically sprout an algorithm. In other words, this
would sort of be a "meta-instrument". Well, I've already mentioned this
on the list before. I think that what I need to do, is to inherit this
class from rhythmic-element, or possibly "note", and have it's
write-event method call the function that will sprout the algorithm.

In the course of trying this approach, I found that I have some
questions in general, regarding implementing the print-object methods
for classes inherited from rhythmic-element or note:

1) There is a macro, "formatting-slots", (which Rick or Tobias brough to
my attention), that seems to be a nice workhorse for easily generating
print methods. But, this does not seem to be actually used much in the
existing note subclasses. I am assuming that this is because this macro
was written after most of the note subclasses were already in place. Is
this assumption correct?

2) I am not sure how the :parameters feature of defobject is used.
Again, it seems that some note subclasses use this, and some do not.
Again, I assume that this is simply an order-of-development issue. Is
this right? Also, I'm not quite sure I understand the intended
distinction between a class slot, and a class slot that is also defined
as a parameter. The only actual use of this I see, is in the
print-object methods of the classes that use parameter lists. Only slots
that are also parameters get printed. Is this the only current/intended
distinction?

3) How does the formatting-slots macro, and the parameter hash table,
inter-relate. It seems to me that their usage is currently orthoganal,
in the sense that formatting-slots doesn't know about parameters, but
just prints all the slots.

Assuming my above assumptions are correct, how about:

a) A macro like formatting-slots, that instead of printing all the
slots, prints only the defined parameters.

b) What about some kind of default print-object method somewhere in the
class heirarchy? If I use defobject to inherit from 
"rhythmic-element", for example, then print-object only prints the
address of the object and not the slot values. I think it would be more
usefull to print all of the slot values (or parameters?) by default.
 

-- Larry Troxler --  lt@westnet.com  --  Patterson, NY USA  --