John Walsh wrote:
>       First, in my on-line Websters, a macro is defined as:
>
>macro n, pl macros [short for macroinstruction] (1959): a single computer
>instruction that stands for a sequence of operations.

One serious problem with this definition is that all  subroutine  and
function mechanisms satisfy it. There are several ways one can take a
chunk of code, give it a name, and then just type the name to make it
happen. It's important (to programmers) to distinguish them, but this
definition groups them all under the term "macro".

The term "macro" was really invented as a way  of  describing  things
(assembler opcodes originally) that are expanded in place rather than
invoked by a "call and return" function mechanism.   A  macro  looked
like  an instruction, but was replaced by a sequence of instructions.
A subroutine is a remote chunk of code that is invoked  by  a  "call"
instruction.

Of course, the computer industry has always  played  fast  and  loose
with  terminology.   Consider the now-common term "in-line function".
You'd think there would be no reason for such a term, since  this  is
the usual meaning of "macro", which has two fewer syllables. But this
would be ignoring the well-established tradition of obfuscating  your
terminology at every opportunity.

(Actually, at least in C compilers, there is sort of a distinct sense
of  "in-line  function".  A "macro" converts chunks of code to C.  An
"in-line function" gets translated directly to assembly code.  But it
is  still  really  just  a  kind of macro.  The distinction is rather
esoteric to everyone except a programmer trying to get the  last  bit
of speed out of a program.)

To subscribe/unsubscribe, point your browser to: http://www.tullochgorm.com/lists.html

Reply via email to