The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
* [TUHS] Unix stories, Stephen Bourne and IF-FI in C code
@ 2017-01-10 13:50 Noel Chiappa
  0 siblings, 0 replies; 21+ messages in thread
From: Noel Chiappa @ 2017-01-10 13:50 UTC (permalink / raw)


    > From: Tony Finch

    > The other classic of Algol 68 literature

No roundup of classic Algol 68 literature would be complete without Hoare's
"The Emperor's Old Clothes".

I assume everyone here has read it, but on the off-chance there is someone
who hasn't, a copy is here:

  http://zoo.cs.yale.edu/classes/cs422/2014/bib/hoare81emperor.pdf

and I cannot recommend it more highly.

	Noel


^ permalink raw reply	[flat|nested] 21+ messages in thread
* [TUHS] Unix stories, Stephen Bourne and IF-FI in C code
@ 2017-01-10  4:40 Rudi Blom
  0 siblings, 0 replies; 21+ messages in thread
From: Rudi Blom @ 2017-01-10  4:40 UTC (permalink / raw)


>Date: Mon, 09 Jan 2017 08:45:47 -0700
>From: arnold at skeeve.com
>To: rochkind at basepath.com
>Cc: tuhs at tuhs.org
>Subject: Re: [TUHS] Unix stories, Stephen Bourne and IF-FI in C code
>Message-ID: <201701091545.v09FjlXE027448 at freefriends.org>
>Content-Type: text/plain; charset=us-ascii
>
>I remember the Bournegol well; I did some hacking on the BSD shell.
>
>In general, it wasn't too unusual for people from Pascal backgrounds to
>do similar things, e.g.
>
>        #define repeat          do {
>        #define until(cond)     } while (! (cond))
>
>(I remember for me personally that do...while sure looked weird for.
>my first few years of C programming. :-)
>
>(Also, I would not recommend doing that; I'm just noting that
>people often did do stuff like that.)

When the Philips computer division worked on MPX (multi-processor
UNIX) in late 80tish they had an include file 'syntax.h' which did a
lot of that Pascal-like mapping.

Here part of it:

/* For a full explanation see the file syntax.help */

#define IF		if(
#define THEN		){
#define ELSIF		}else if(
#define ELSE		}else{
#define ENDIF		}
#define NOT		!
#define	AND		&&
#define	OR		||
#define CASE		switch(
#define OF		){
#define ENDCASE		break;}
#define WHEN		break;case
#define CWHEN		case
#define IMPL		:
#define COR		:case
#define BREAK		break
#define WHENOTHERS	break;default
#define CWHENOTHERS	default
#define SELECT		do{{
#define SWHEN		}if(
#define SIMPL		){
#define ENDSELECT	}}while(0)
#define SCOPE		{
#define ENDSCOPE	}
#define BLOCK		{
#define ENDBLOCK	}
#define FOREVER		for(;;
#define FOR		for(
#define SKIP
#define COND		;
#define STEP		;
#define LOOP		){
#define ENDLOOP		}
#define NULLOOP		){}
#define WHILE		while(
#define DO		do{
#define UNTIL		}while(!(
#define ENDDO		))
#define EXITWHEN(e)	if(e)break
#define CONTINUE	continue
#define RETURN		return
#define GOTO		goto


^ permalink raw reply	[flat|nested] 21+ messages in thread
[parent not found: <mailman.1.1484013601.5032.tuhs@minnie.tuhs.org>]
* [TUHS] Unix stories, Stephen Bourne and IF-FI in C code
@ 2017-01-09  2:30 Norman Wilson
  2017-01-09  3:31 ` Steve Johnson
  0 siblings, 1 reply; 21+ messages in thread
From: Norman Wilson @ 2017-01-09  2:30 UTC (permalink / raw)


Doug McIlroy:

  There was some pushback which resulted in the strange compromise
  of if-fi, case-esac, do-done. Alas, the details have slipped from
  memory. Help, scj?

====

do-od would have required renaming the long-tenured od(1).

I remember a tale--possibly chat in the UNIX Room at one point in
the latter 1980s--that Steve tried and tried and tried to convince
Ken to rename od, in the name of symmetry and elegance.  Ken simply
said no, as many times as it took.  I don't remember who I heard this
from; anyone still in touch with Ken who can ask him?

Norman Wilson
Toronto ON


^ permalink raw reply	[flat|nested] 21+ messages in thread
* [TUHS] Unix stories, Stephen Bourne and IF-FI in C code
@ 2017-01-09  1:06 Doug McIlroy
  2017-01-09  2:18 ` Random832
  0 siblings, 1 reply; 21+ messages in thread
From: Doug McIlroy @ 2017-01-09  1:06 UTC (permalink / raw)


>  if-fi and case-esac notation from Algol came to shell [via Steve Bourne]

There was some pushback which resulted in the strange compromise
of if-fi, case-esac, do-done. Alas, the details have slipped from
memory. Help, scj?

doug


^ permalink raw reply	[flat|nested] 21+ messages in thread
* [TUHS] Unix stories, Stephen Bourne and IF-FI in C code
@ 2017-01-08 20:37 Walter F.J. Mueller
  2017-01-08 21:12 ` Larry McVoy
                   ` (2 more replies)
  0 siblings, 3 replies; 21+ messages in thread
From: Walter F.J. Mueller @ 2017-01-08 20:37 UTC (permalink / raw)


There was thread 'Unix stories' were Stephen Bourne played role.

Here another story about Stephen Bourne. He worked first on Algol 68,
than joined the Unix team at Bell labs and wrote sh and adb. It's well
known that the if-fi and case-esac notation from Algol came to shell
syntax this way.

Maybe less know is that Bourne tried as hard as he could to make the
C code of sh and adb look like Algol, with the help of preprocessor
macros. I stumbled across this when I looked into the 2.11BSD code
base some time ago. Look at

   http://www.retro11.de/ouxr/211bsd/usr/src/bin/sh/main.c.html
   http://www.retro11.de/ouxr/211bsd/usr/src/bin/adb/main.c.html

to enjoy C with an Algol-look. The definitions are in

   http://www.retro11.de/ouxr/211bsd/usr/src/bin/sh/mac.h.html
   http://www.retro11.de/ouxr/211bsd/usr/src/bin/adb/defs.h.html


		Cheers, 	Walter


^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2017-01-11  6:00 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-10 13:50 [TUHS] Unix stories, Stephen Bourne and IF-FI in C code Noel Chiappa
  -- strict thread matches above, loose matches on Subject: below --
2017-01-10  4:40 Rudi Blom
     [not found] <mailman.1.1484013601.5032.tuhs@minnie.tuhs.org>
2017-01-10  3:11 ` Paul McJones
2017-01-09  2:30 Norman Wilson
2017-01-09  3:31 ` Steve Johnson
2017-01-09 15:30   ` Marc Rochkind
2017-01-09 15:45     ` arnold
2017-01-09 15:59       ` ron minnich
2017-01-09 16:03       ` Clem Cole
2017-01-10 18:44         ` Lawrence Stewart
2017-01-09 18:48     ` Derek Fawcus
2017-01-09 20:35     ` Steve Johnson
2017-01-10 12:24       ` Tony Finch
2017-01-11  6:00   ` Brantley Coile
2017-01-09  1:06 Doug McIlroy
2017-01-09  2:18 ` Random832
2017-01-08 20:37 Walter F.J. Mueller
2017-01-08 21:12 ` Larry McVoy
2017-01-08 21:26   ` Dave Horsfall
2017-01-08 21:54 ` Kay Parker   
2017-01-08 23:14 ` Adam Sampson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).