.BG
.VE $Header: /usr3/s/current/s/.help/RCS/define,v 1.2 83/12/30 19:27:23 rab Exp $
.FN define
.TL
define: Define a Macro
.CS
define(file, pos, print)
.PP
.AG file
optional character string giving the name of a file which
contains definitions for one or more macros.  If file is
omitted, definitions are read from the terminal.
.AG pos
data directory position on which macros are to be saved.
Default 2.
.AG print
logical, should names of defined macros be printed?
Default TRUE for macros defined from `file', FALSE
for macros defined from the terminal.
.PP
`define' is used to create new S macro definitions.  When `define' reads from
terminal, it initially prompts with the string "N>", indicating that it
expects the line giving the macro name and arguments.  At this point,
the user should give a line of the form
.PP
  MACRO name(arg1/default value/,arg2/default/,...)
.PP
The prompt then turns to "D>", indicating a request for the definition
of the macro.  The definition continues until a line that just
contains "END".
.PP
Define then prompts "N>" for another macro name.  An empty line in
response to this prompt terminates the definition process.
Definitions from a file are terminated by the end of file.
.PP
See also `mprint' and `medit' to print and edit macro definitions.
.PP
The keywords `MACRO' and `END' must appear in upper case.
.EX
> define      #define a macro incr
N> MACRO incr(x,y/1/)
D> (x+y)
D> END
N>
> ?incr(5)*2
.KW macros
.KW basic*
.WR
