Path: utzoo!utgpu!water!watmath!clyde!rutgers!gatech!hao!noao!arizona!naucse!sbw From: sbw@naucse.UUCP (Steve Wampler) Newsgroups: comp.lang.c Subject: Re: The D Programming Language (was: Still more new operators) Summary: i(x1,...,xn) not *too* expensive, he says Message-ID: <563@naucse.UUCP> Date: 10 Feb 88 00:12:14 GMT References: <11702@brl-adm.ARPA> <558@naucse.UUCP> <2523@haddock.ISC.COM> Organization: Northern Arizona University, Flagstaff, AZ Lines: 21 In article <2523@haddock.ISC.COM>, karl@haddock.ISC.COM (Karl Heuer) writes: > In article <558@naucse.UUCP> rrr@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}