Path: csiph.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Bob Eager Newsgroups: alt.folklore.computers,comp.sys.raspberry-pi Subject: Re: Is it a lost cause? Date: 3 Jul 2016 13:06:03 GMT Lines: 54 Message-ID: References: <20160613210220.7d9874b5@maxa-pc.cpe.bvcom.net> <440983857.489168038.520479.peter_flass-yahoo.com@news.eternal-september.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Trace: individual.net 2fnITgdhFrUrPrlXEosUZQwWhJoH8QM3VuWiFkoRFEV20wtCLG Cancel-Lock: sha1:Eqss1DoB16XgSMfl2XBoCaXEUQU= User-Agent: Pan/0.139 (Sexual Chocolate; GIT bf56508 git://git.gnome.org/pan2) Xref: csiph.com alt.folklore.computers:166394 comp.sys.raspberry-pi:12337 On Sun, 03 Jul 2016 12:21:03 +0000, Martin Gregorie wrote: > On Sun, 03 Jul 2016 11:39:20 +0000, Bob Eager wrote: >> In general, if A contained a memory address, then A was an array >> pointer, regardless of what it pointed to. Then the first element was >> A!0, second was A!1, etc. Or A!B, where B was an arbitary value. >> This was syntactic sugar for adding A to B and then using the resulting >> address for memory access. >> > Understood, and not to different from C, PL/9 etc. Exactly. C is much the same, but with a bit more syntactic sugar. >> To declare an array, you generally used a library function ('newvec' I >> think) that was like malloc in C (and on which malloc was based), thus >> getting the address of some memory you could treat as an array. Or you >> could declare a local array with: >> let x = vec 100 >> which declared 102 cells (0 to 100, plus one (named x) that pointed to >> the base of the 101 cells). >> > Thanks for the reminder. I think I'd have looked at BCPL in 1974, so I > was certain it must have had arrays or it couldn't have been used to > write the GPM, but I've entirely forgotten its syntax apart from it > being block structured. There seem to be several implementations of GPM these days, nit all correct apparently. I have never used it in anger, but I use ML/I quite a bit (e.g. to make it easier to write firewall rules). >> One last weird one. You could declare a table of predefined values: >> let x = TABLE 1,2,3,4,5 >> or whatever. x would get the address of the first cell. By filling the >> table with actual machine instructions, you could then execute them >> with: >> goto x >> or even >> x() >> > IOW implementing a computed goto or function call would be as straight > forward as doing it in assembler - and very similar too. Yes, you could have arrays of functions, for example - with a *much* simpler syntax than you have for C - but that's because BCPL is both typeless, and there is no check either on the number of arguments passed to a function! -- Using UNIX since v6 (1975)... Use the BIG mirror service in the UK: http://www.mirrorservice.org