Path: utzoo!utgpu!water!watmath!clyde!bellcore!decvax!eagle_snax!gpollice From: gpollice@eagle_snax.UUCP ( Sun ECD Software) Newsgroups: comp.lang.c Subject: Re: The D Programming Language (was: Still more new operators) Summary: Another D language Message-ID: <243@eagle_snax.UUCP> Date: 9 Feb 88 14:24:14 GMT References: <11702@brl-adm.ARPA> Lines: 34 In article <11702@brl-adm.ARPA> dsill@NSWC-OAS.arpa (Dave Sill) writes: >>Some years ago I invented the hypothetical notation "e1 ,, e2", which would be >>like the comma operator in that it evaluates its left operand before its >>right operand, but (unlike comma) the result would be the value of the left >>operand. Look what this buys us: >> a,, a=b /* displacement operator, like a :=:= b */ >> a=(b,, b=a) /* a simple swap */ >> x,, ++x /* same as x++; but generalizable */ >> free(stack,, stack=stack->next) /* pop stack */ >> stack->value,, pop(stack) /* pop and return stacked value */ > >I like it. Nice and general, fills a gap missing in C. It's not C, >but it could be D (it *should* be D, not P (pee?)). Actually, the last project course at the late Wang Institute developed a compiler and editor for the D language called Turbo-D. The D language we used was taken from Dijkstra's guarded command language in his book "A Discipline of Programming." For the simple swap you have shown, the D syntax seemed to be much cleaner: a,b := b,a The language had some other features, including non-determinate selection of guards for loops and conditional statements. The project was fun, the language was useful, and the compiler was fast. -- Gary F. Pollice | Remember the Wang Institute!! Sun Microsystems | ARPAnet: gpollice@sun.com Two Federal Street | UUCP: {decwrl,ihnp4,hplabs,ucbvax}!sun!gpollice Billerica, MA 01821 | (617)671-0374