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

Brian T. Schellenberger bts at sas.UUCP
Fri Feb 19 15:59:50 AEST 1988


|> 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  <problems?>

Actually, there is a much more natural and powerful way to handle this in D:
one of the nicer things about C is the way you can get letters out of strings
by doing things like:

     "abcdefghijklmnopqrstuvwxyz"[letter]

Why not extend this and allow in-line arrays?  This would allow the "choose"
operator to work as, for example:

    array int {x1, x2, x3, ...}[i]

This of course means that "abc" is exactly the same as 

    array char {'a', 'b', 'c', '\0'}


. . . just another silly idea.
-- 
                                                         --Brian.
(Brian T. Schellenberger)				 ...!mcnc!rti!sas!bts

DISCLAIMER:  Whereas Brian Schellenberger (hereinafter "the party of the first 



More information about the Comp.lang.c mailing list