Path: csiph.com!xmission!usenet.csail.mit.edu!news.iecc.com!.POSTED.news.iecc.com!nerds-end From: gah4 Newsgroups: comp.compilers Subject: Re: TeX syntax? Date: Mon, 5 Apr 2021 13:29:02 -0700 (PDT) Organization: Compilers Central Lines: 40 Sender: news@iecc.com Approved: comp.compilers@iecc.com Message-ID: <21-04-005@comp.compilers> References: <07-02-024@comp.compilers> <21-04-002@comp.compilers> <21-04-004@comp.compilers> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: gal.iecc.com; posting-host="news.iecc.com:2001:470:1f07:1126:0:676f:7373:6970"; logging-data="74656"; mail-complaints-to="abuse@iecc.com" Keywords: syntax, macros Posted-Date: 06 Apr 2021 13:38:34 EDT X-submission-address: compilers@iecc.com X-moderator-address: compilers-request@iecc.com X-FAQ-and-archives: http://compilers.iecc.com In-Reply-To: <21-04-004@comp.compilers> Xref: csiph.com comp.compilers:2645 On Monday, April 5, 2021 at 7:55:35 AM UTC-7, gah4 wrote: (snip, John wrote) > [The m4 macro processor tokenizes its input and then checks to see > if a token is a named macro. It's still used for autoconf > configuration scripts. -John] I know about m4, but have managed never to use it. Things that I might have done with it, I usually do with awk. Continuing TeX syntax, white space is ignored after a macro named with letters, (but not the other ones). That is useful if you use a macro before actual text words. Also it means that you can ignore newlines that come after a macro named with letters, but not other ones. You can cause it to ignore a newline otherwise by ending with a comment, with (usually) a %. (As with all characters, you can change the catcode, but usually %.) One other funny thing, though. TeX has glue specifications, such that one might say: \hskip 1cm plus 0.5cm minus 0.5m for horizontal space that can stretch or shrink in line justification. the plus and minus parts are optional. Often macros expand to glue: \def\somespace{\hskip 1cm} and I actually knew someone to use such a macro followed by the word plus that wasn't part of glue, and resulting in a very strange message. I suppose one should put a \relax (the no-op macro) after every glue, but that is pretty rare. What is the chance that one might actually say 'plus' or 'minus' at that point! But the sometimes significant sometimes not white space is a real complication in actual use, and will also complicate a BNF representation.