Path: utzoo!mnetor!uunet!seismo!sundc!pitstop!sun!quintus!ok From: ok@quintus.UUCP (Richard A. O'Keefe) Newsgroups: comp.lang.c Subject: Re: The D Programming Language Message-ID: <703@cresswell.quintus.UUCP> Date: 27 Feb 88 11:39:48 GMT References: <11702@brl-adm.ARPA> <243@eagle_snax.UUCP> <2245@geac.UUCP> <24935@cca.CCA.COM> Organization: Quintus Computer Systems, Mountain View, CA Lines: 36 Summary: BCPL == D ? (:-) In article <24935@cca.CCA.COM>, g-rh@cca.CCA.COM (Richard Harter) writes: > Here is an alternative to endif et al. Use labels to start blocks and > 'end labels' to end them. For example, > > if (boolean expression) > foo: .... > end foo > else > bar: .... > end bar > He has just re-invented BCPL. Where C has { and }, BCPL had $( and $). The name for these was "section brackets". There was an extra hack: "tagged section brackets". If looked like an identifier, $( and $) were tagged section brackets (each was a single token). So in BCPL this example would be TEST boolean-expression THEN $(FOO ... $)FOO ELSE $(BAR ... $)BAR PL/I has a similar feature, one can write label: DO; statements END label; /* I may have this wrong */ There is a difference, though. In BCPL, the tags on the brackets must match exactly, but in PL/I a tagged END may close any number of tagged and untagged DOs. Can anyone who has experience with using this feature suggest why it has remained rare. In particular, does anyone know why it isn't in C, given that it was in BCPL? (Not that I think it's needed.)