The D Programming Language (was: Still more new operators)

Dave Sill dsill at NSWC-OAS.arpa
Mon Feb 8 05:29:25 AEST 1988


>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?)).

Maybe we should start a new newsgroup/mailing-list for the discussion
of such things.  It seems like a lot of the current discussion here is
about things that will never make it into ANSI C such as a power
operator, `noalias' :-) et cetera.  Sure would improve the S/N ratio
for those interested only in C.

=========
The opinions expressed above are mine.

"The limits of my language mean the limits of my world."
					-- Ludwig Wittgenstein



More information about the Comp.lang.c mailing list