# Command -- the class of all commands

## Synopsis

• Usage:
Command g
• Inputs:
• g, a function or a string
• Outputs:
• a new command that will evaluate g() if g is a function, and will evaluate run g if g is a string

## Description

A command behaves as a function does if it is followed by an adjacent expression that can serve as its argument or argument list. In addition, if it appears as the value of an expression typed by the user at top level (i.e., not in a file), then it gets executed with empty argument list.
 i1 : (f = Command ( () -> 2^30 );) i2 : f o2 = 1073741824 i3 : (c = Command "date";) i4 : c Thu 27 May 2021 10:31:02 PM UTC o4 = 0

• run -- run an external command
• AfterEval -- top level method applied after evaluation

## Methods that use a command :

• ? Command (missing documentation)
• "code(Command)" -- see code -- display source code
• "Command Thing"
• Command \ Set (missing documentation)
• "methodOptions(Command)" -- see methodOptions(Function) -- recover the options used when a method function was created
• "methods(Command)" -- see methods -- list methods
• "options(Command)" -- see options(Function) -- get optional arguments and default values for a function that accepts them
• Set / Command (missing documentation)
• /// Command \\ Thing /// -- see Thing // Function -- apply a function
• "Thing // Command" -- see Thing // Function -- apply a function
• /// Command \ String /// -- see VisibleList / Function -- apply a function to elements of a list
• /// Command \ VirtualTally /// -- see VisibleList / Function -- apply a function to elements of a list
• /// Command \ VisibleList /// -- see VisibleList / Function -- apply a function to elements of a list
• "List / Command" -- see VisibleList / Function -- apply a function to elements of a list
• "String / Command" -- see VisibleList / Function -- apply a function to elements of a list
• "VirtualTally / Command" -- see VisibleList / Function -- apply a function to elements of a list
• "VisibleList / Command" -- see VisibleList / Function -- apply a function to elements of a list

## For the programmer

The object Command is , with ancestor classes BasicList < Thing.