[TUHS] v7 source code for sh

Ron Natalie ron at ronnatalie.com
Sun Feb 20 03:24:42 AEST 2022


This persisted in the shell until S5R2 when someone gratefully undid all those macros.  adb was similarly afflicted. 

> On Feb 19, 2022, at 11:04, Steve Nickolas <usotsuki at buric.co> wrote:
> 
> ´╗┐On Sat, 19 Feb 2022, Will Senn wrote:
>> I have been poring through the v7 source code lately, and came across an oddity I would like to know more about. Specifically, in sh. The code for sh is c, but it makes *extensive* use of of macros, for example:
> 
> <snip>
> 
>> I can read the resultant code through the lens of my experience coding c, but I'm curious why the macros and how this came about? In v6, the sh source is straight up c. Is there a story behind it worth knowing?
> 
> Apparently Bourne was heavily into ALGOL, and used those macros to make C into something more familiar.
> 
> At least, that's what I concluded by reading her Wikipedia page as well as the code.
> 
> -uso.



More information about the TUHS mailing list