Macaulay2 » Documentation
Packages » Macaulay2Doc » The Macaulay2 language » lists and sequences » BasicList » Command
next | previous | forward | backward | up | index | toc

Command -- the class of all commands

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 May 15 13:42:08 UTC 2025

o4 = 0

See also

Methods that use a command:

Protected objects of class Command:

For the programmer

The object Command is a self initializing type, with ancestor classes BasicList < Thing.


The source of this document is in Macaulay2Doc/ov_repl.m2:1139:0.