requires: {#ExtensibleArray}. provides: {#Command. #CommandMap. #MenuCommand}. prototypes addPrototype: #Command derivedFrom: {Cloneable}. "A command is an object that represents a user interaction. Commands are stored with the command name and a list of the arguments. All positional arguments will be represented in the command object, but only those keywords arguments that were explicitly supplied by the user will be included. When the Command is invoked, the code representing that interaction is executed." Command addSlot: #name valued: ''. Command addSlot: #arguments valued: ExtensibleArray newEmpty. prototypes addSlot: #UnsuppliedArgument valued: Oddball clone. "A marker object for unsupplied arguments to Commands." c@(Command traits) isPartial "A partial Command is one with UnsuppliedArgument in place of any required argument." [ c arguments identityIncludes: UnsuppliedArgument ]. c@(Command traits) newNamed: name withArgs: arguments executing: block [ ]. c@(Command traits) execute "Executing the Command." [shouldOverrideThis]. prototypes addPrototype: #CommandMap derivedFrom: {Dictionary}. "Menus and Command-sets" CommandMap addSlot: #name. CommandMap addSlot: #mapDelegates valued: {}. CommandMap addSlot: #translators. CommandMap addSlot: #accelerators. CommandMap addSlot: #menu. "TODO: clean these slots up." c@(Command traits) installIn: map@(CommandMap traits) [ ]. prototypes addPrototype: #MenuCommand derivedFrom: {Association}. MenuCommand addSlot: #name valued: ''. "TODO: Make it a symbol?" MenuCommand addSlot: #documentation valued: ''. "A doc-string or doc-object." MenuCommand addSlot: #keyStroke. "The InputEvent used to invoke it."