3/15/72                                                    M6 (I)





NAME            m6 -- general purpose macro processor



SYNOPSIS        m6 [ -d arg1 ] [ arg2 [ arg3 ] ]



DESCRIPTION     m6 takes input from file arg2 (or standard input

                if arg2 is missing) and places output on file

                arg3 (or standard output).  A working file of

                definitions, "m.def", is initialized from  file

                arg1 if that is supplied.  M6 differs from the

                standard [1] in these respects:



                #trace:, #source: and #end: are not defined.



                #meta,arg1,arg2: transfers the role of metachar-

                acter arg1 to character arg2. If two metacharac-

                ters become identical thereby, the outcome of

                further processing is not guaranteed.  For exam-

                ple, to make []{} play the roles of #:<> type



                     \#meta,<\#>,[:

                     [meta,<:>,]:

                     [meta,[substr,<<>>,1,1;,{]

                     [meta,[substr,{{>>,2,1;,}]



                #del,arg1: deletes the definition of macro arg1.



                #save: and #rest: save and restore the definition

                table together with the current metacharacters on

                file m.def.



                #def,arg1,arg2,arg3: works as in the standard

                with the extension that an integer may be sup-

                plied to arg3 to cause the new macro to perform

                the action of a specified builtin before its re-

                placement text is evaluated.  Thus all builtins

                except #def: can be retrieved even after dele-

                tion.  Codes for arg3 are:



                     0 - no function

                     1,2,3,4,5,6 - gt,eq,ge,lt,ne,le

                     7,8 - seq,sne

                     9,10,11,12,13 - add,sub,mpy,div,exp

                     20 - if

                     21,22 - def,copy

                     23 - meta

                     24 - size

                     25 - substr

                     26,27 - go,gobk

                     28 - del

                     29 - dnl

                     30,31 - save,rest



FILES           m.def--working file of definitions

                /sys/lang/mdir/m6a--m6 processor proper (/bin/m6

                is only an initializer)

                /sys/lang/mdir/m6b--default initialization for

                m.def



SEE ALSO        [1] M6 reference



DIAGNOSTICS     "err" -- a bug, an unknown builtin or a bad defi-

                nition table

                "oprd"--can't open input or initial definitions

                "opwr"--can't open output "ovc" -- overflow of

                nested calls

                "ova" -- overflow of nested arguments

                "ovd" -- overflow of definitions

                "rdd" -- can't read definition table

                "wrd" -- can't write definition table, either on

                #save: or on garbage collection



BUGS            Characters in internal tables are stored one per

                word.  They really should be packed to improve

                capacity.  For want of space (and because of un-

                packed formats) no file arguments have been pro-

                vided to #save: or #rest: Again to save space,

                garbage collection makes calls on #save: and

                #rest: and so overwrites m.def.



OWNER           doug