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

Need some help with converting to the Rel7 command processor



    Date: Thu, 2 Jul 87 11:41 EDT
    From: Mark H. Shirley <MHS@ht.ai.mit.edu>

    My problem is that the command processor has been changed a lot.  I can't
    figure out which, if any, of the functions in CP: corresponded to the old
    SI:DEFINE-CP-TYPE.  I've looked through the release notes and documentation
    and don't see either mention of the change (I'm not sure this function was
    previously documented) nor how to accomplish the same functionality in Genera.

    Does anybody have any suggestions?

    Thanks,
	    Mark Shirley

The closest thing to SI:DEFINE-CP-TYPE is DEFINE-PRESENTATION-TYPE.
However, I don't think you need that for what you are doing.  Here's how
I would write a command that wants an argument that is a member of an
enumeration computed at runtime.

(defvar *thing* '(("A" . a) ("B" . b)))

(cp:define-command (command :comtab "User")
    ((arg `(alist-member :alist ,*thing*)))
   (print arg))

Command: Command (A or B) A

A 
Command: (push '("C" . c) *thing*)
(("C" . C) ("A" . A) ("B" . B))
Command: Command (C, A, or B) C

C

						barmar