language and programming overview
In this section we give a comprehensive overview of the user language and the main programming features of Macaulay 2.
variables and symbols
valid names
assigning values
local variables in a file
viewing the symbols defined so far
subscripted variables
numbered variables
overview of functions
using functions
making functions
local variables in a function
making functions with a variable number of arguments
using functions with optional arguments
making new functions with optional arguments
basic types
strings
nets
lists
sequences
hash tables
control structures
loops
mapping over lists
mapping over hash tables
conditional execution
error handling
input and output
printing to the screen
reading files
getting input from the user
creating and writing files
two dimensional formatting
communicating with programs
using sockets
interfacing with the system
classes and types
what a class is
installing methods
inheritance from parents
making new types
printing and formatting for new types
method functions
making a new method function
method functions with a variable number of arguments
method functions with optional arguments