The FACTOR.CMD sample in the \TOOLKIT\SAMPLES\REXX directory demonstrates a way to define a factorial class using the subclass method and the .methods environment symbol.
For this sample to function properly, Object REXX must be installed.