The main problem with the constructs is that they are not
understood by "emacs", "cb" etc..
-------------------------------------------------------------
#define begin {
#define end }
#define IF if(
#define THEN ){
#define ELSE } else {
#define ELIF } else IF
#define FI }
#define FOR for(
#define WHILE while(
#define DO ){
#define OD }
#define LOOP do{
#define UNTIL } while(
#define DONE );
#define SWITCH switch(
#define IN ){
#define CASE ;break ;case
#define DEFAULT ;break ; default
#define OUT }
#define FOREACH(PARC,PARV,COUNT)\
for(COUNT = (PARC > 1 ? 0 : --PARV, -1) ; ++COUNT == 0 | (++PARV, --PARC > 0 ; )\
#ifndef DO
#define DO ){
#define OD }
#endif
#define PARNUM(NUM,PARV,COUNT) (PARV+NUM-COUNT)
#define FORNEXT(PARC,PARV,COUNT) (++COUNT, ++PARV, --PARC)
/* PARNUM returns the NUM'th par. FORNEXT moves to the next par */
-----------------------------------------------------------------
FOREACH was defined to help handle shell pars with a minimum
of fuss. PARC and PARV are (copies of) the values passed by the
shell and COUNT is used to indicate which par is presently
"active" (COUNT==0 indicates no pars).
Stephen Samuel(alberta!stephen)
Sorry for the outburst, but I feel the urge to counter the previous
article, which seemed to espouse such gimmickry as a good idea.
Alan Silverstein, Hewlett-Packard Fort Collins Systems Division, Colorado
ucbvax!hplabs!hpfcla!ajs, 303-226-3800 x3053, N 40 31'31" W 105 00'43"