Assigning custom properties



I would like to assign a property to an object or expression in Maxima that is not already known to Maxima.  For example
I would like to be able to say, declare(expr, 'piecewise) even though there is no such thing to Maxima.

Can this be done?  Can I make up properties and write my own code that can handle expressions that have these
properties?


Rich