[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
do program commands act like generic functions?
Suppose that I build two programs p1 and p2 on top of dw:program using
the define-program-framework construct. I want to define the command
quit-activity for both of them. So I do
(define-p1-command (com-quit-activity) () )
(define-p2-command (com-quit-activity) () )
When I compile the second definition the compiler warns me that
com-quit-activity was previously defined and prompts me as to whether I
want to redefine it. I answer yes and it seems to me that they both
work correctly in their context (i.e., p1 or p2).
If my assessment is right, it seems to me that the reason is that the
parts of the com-quit-activity command definition, i.e.
com-quit-activity-internal and com-quit-activity-parser are implemented
as generic functions, with methods defined for each of the program
flavors. Then, is there any reason for not implementing the entire
command as a generic function?
Of course my main question remains: Is it true that for all practical
purposes program commands act like generic functions?