views:

155

answers:

3

In light of the "Hidden features of..." series of questions, what little-known features of BCPL have become useful to you?

+1  A: 

The best "hidden feature" of BCPL is the one I use on my CV - I hide the fact that I know anything about it, and thus avoid all chance of being drafted onto one of those benighted projects that might still contain some BCPL. Also, perfect the automatc response:

"Weird! Is that some kind of Perl stuff?"

when unexpectedly confronted with BCPL code.

anon
I've occasionally had to explain to recruiters what it was. But it's still in use on at least three sites I've done work for, one of them still running on a 6809 processor. So I don't think it's entirely dead.
paxdiablo
+1  A: 

Curly brackets. Granted, it's not a particularly hidden feature, nor have I used them in BCPL itself; but it did originate in BCPL, and it's the only notable thing about BCPL for the modern programmer.

Colin Pickard
"Curly brackets" is a misnomer because the brackets weren't. BCPL (at least the incarnations I used) had "LET x() = VALOF $( ... $)" (not a curl in sight).
paxdiablo
We should update Wikipedia :)
Colin Pickard
I've never seen the {} variant in BCPL but I wouldn't discount its existence - standards were somewhat less important back then. I know it did have a way of enforcing bracket matching with "$(1 ... $(2 ... $)2 ... $)1" which C/++ still doesn't have although people often use comments - BCPL compilers checked them though to ensure structure was as expected.
paxdiablo
+2  A: 

The best feature I saw (and this was only in a few implementations, not part of the base language from Martin Richards) was the use of "%%" and "%!" (I may have those two characters in the last one around the wrong way - it's been a while).

BCPL provided a dereferencing facility to extract a word from a word address with word offset by doing:

LET x = y!2

which would be similar to y[2] in C.

The byte offset from byte address (%%) and byte offset from word address (%!) allowed much finer-grained control of memory access in the old CPUs (such as the 6800 and 6809) where BCPL was mostly used.

paxdiablo