On Thu, 28 Jan 2021, at 20:40, Bob Bridges wrote:

> By the way, what in y'all's opinion is the proper use of the word "macro"?

The classic computer science meaning is explained at:

https://en.wikipedia.org/wiki/Macro_(computer_science)

- it's where one character sequence is detected in a file and replaced by 
another.  The place you're most likely to see simple ones is in C programs
with things like 

#define PI 3.14159

so that wherever PI  is placed in program source the C preprocessor will
replace those two characters by the seven characters: 3.14159

It also supports more complex string substitutions where eg 

#define RADTODEG(x) ((x) * 57.29578)

means that an instance of  RADTODEG(17) in the program is replaced by 
the character string ((17) * 57.29578).

The string is not evaluated - it's a direct string substitution before the 
compiler gets to see the code.

The other obvious place is in Assembler where every time a macro is 
found in the code it is replaced by the instruction sequence it generates.


The way that some applications record keystrokes and can then play them
back is closer to this meaning of "macro" because they work by replacing 
a shortcut found in the keyboard buffer with the sequence of recorded 
keystrokes, as if the user had typed them instead.

Of course, such processes these days tend also to record things like mouse
clicks, so it's not so obviously just a character string replacement.
 

I don't know why programs that run within an editor are named macros. 
Maybe the earliest ones were?  If you say that a macro name placed in 
the command line gets removed and replaced by a stored sequence of 
editor commands, it's the same idea.  But by the time the macro gets 
to the point of supporting a whole programming language of its own
and might not issue any editor commands at all, it's harder to justify.


-- 
Jeremy Nicoll - my opinions are my own.

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to