🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.misc
Article #6334

Re: language commenting constructs

#6334
From: Tom Almy
Date: Mon, 20 Mar 1989 16:37
41 lines
1999 bytes
(Actual subject, BCPL syntax)
In article <3452@ficc.uu.net> peter@ficc.uu.net (Peter da Silva) writes:
>In article <39273@oliveb.olivetti.com>, chase@Ozona.orc.olivetti.com (David Chase) writes:
>>         LET min2(a,b) = a < b -> a,b
>
>Take your pick:
>
>	min2(a,b) { return (a < b) ? a : b; }
>	#define min2(a,b) (((a) < (b)) ? (a) : (b))
>-- 

You are actually missing a certain subtlety here.  The BCPL statement
when executed assigns the address of the code segment to variable min2.
BCPL (at least on the IBM 360 that I used around 1970) linked separate
compilation modules in an interesting way:

1. BCPL maintains a global common area with numbered (ugh!) slots.

2. Somewhere in the program is a list of compilation module names.

3. When the program loads, each module gets called in turn.

4. The top level code in each module consists of procedure (and global
   data declarations) which assign the routine addresses in the common
   area.

5. The "main" module, which is last in the list, contains the main procedure
    which now has access to procedures in any module!

Pretty clever, heh? Sorta looks a bit like Modula-2?

If you are really tricky, you could do something like:

	temp, min, max := min, max, temp

to exchange the functions "min" and "max" anywhere they are used!

Tom Almy
toma@tekgvs.labs.tek.com
Standard Disclaimers Apply
(And I haven't used BCPL in over 15 years now)
Technical Details
Message-ID: <4799@tekgvs.LABS.TEK.COM>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!agate!helios.ee.lbl.gov!ncis.llnl.gov!lll-winken!uunet!tektronix!tekcrl!tekgvs!toma
References: <1543@zen.UUCP> <10460@lanl.gov> <39273@oliveb.olivetti.com> <3452@ficc.uu.net>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!agate!helios.ee.lbl.gov!ncis.llnl.gov!lll-winken!uunet!tektronix!tekcrl!tekgvs!toma
From: toma@tekgvs.LABS.TEK.COM (Tom Almy)
Newsgroups: comp.lang.misc
Subject: Re: language commenting constructs
Message-ID: <4799@tekgvs.LABS.TEK.COM>
Date: 20 Mar 89 16:37:23 GMT
References: <1543@zen.UUCP> <10460@lanl.gov> <39273@oliveb.olivetti.com> <3452@ficc.uu.net>
Reply-To: toma@tekgvs.LABS.TEK.COM (Tom Almy)
Organization: Tektronix, Inc., Beaverton,  OR.
Lines: 41