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

Steve Wampler sbw at naucse.UUCP
Wed Feb 10 10:12:14 AEST 1988


In article <2523 at haddock.ISC.COM>, karl at haddock.ISC.COM (Karl Heuer) writes:
> In article <558 at naucse.UUCP> rrr at naucse.UUCP (Bob Rose ) writes:
> >But wait, we can do better [than the proposed ",,"]. ...
> >              i(x1, x2, x3, ..., xn)
> >[where 1 <= i <= n; the result is xi]
> ...  If `i' is allowed to be an arbitrary integral
> expression (which I presume is the case in interpretive Icon), then it is
> indeed more powerful but also more expensive to compute.  Part of the beauty
> of `,,' is that it has a cost comparable to `,'.

Actually, if 'i' is an arbitrary integral expression, it isn't that much more
expensive to implement than if it's a constant - most of the evaluation
mechanism is already in place in C (excuse me, 'D').  The only extra expense
over computing the value if 'i' is a constant is the cost of evaluating the
expression for 'i' and a simple transfer.


Sigh, let's just keep postnews happy here...
-- 
	Steve Wampler
	{....!arizona!naucse!sbw}



More information about the Comp.lang.c mailing list