[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Quickie question on CLIM application command semantics and approach

I have two very simple questions about what would the best way to implement
application commands on my CLOS objects.

1) If I have two or more clos class objects that I want to execute the same
application command on. Which is the better approach?

Lets say my classes are called A and B.

(define-my-application-command (do-something :name t) ((object (or A B))

or can I do it this way

(define-my-application-command (do-something :name t) ((object 'A))

(define-my-application-command (do-something :name t) ((object 'B))

Is it more efficient, especially if I want the same command "do-something"
to the object slightly differently based upon its type.

2) Is there a way to eliminate needing a colon on the keyword args in the
command.  I want to emulate &optional arg another-arg and so on capability within the application command definition.

If I do

(define-my-application-command (do-something :name t)
		((object A) &key one-way another-way) ...)

and invoke the command in my interactor pane it shows up as:

do-something OBJECT-A-PRINT :one-way   as I type it in.  How can I eliminate
those colons.  Or am I stuck with including my own calls to ACCEPT within
the command definition form to emulate optional args?