what should be added to C

Davidsen davidsen at steinmetz.UUCP
Fri Jun 13 04:00:45 AEST 1986


In article <1006 at umd5.UUCP> zben at umd5.UUCP (Ben Cranston) writes:
>In article <8200005 at ztivax.UUCP> david at ztivax.UUCP writes:
>> (condensed to "don't make := assignment")
>
>Clearly "=" should remain the assignment operator.  We should replace all
>testing with the extended syntax:
>
>...
>   switch (a:b) {
>   case <: isgreater; break;
>   case =: isequal; break;
>   case >: isless; break;
>   default: yell("this cannot happen!\n");
>   }
>...
>
I really like this! I don't propose that we use it, but I like it! It
reminds me that the only thing I miss in FORTRAN is the arithmetic IF,
when I write certain types of quick and dirty comparisons. Perhaps we
could also take inspiration from the ? triadic operator and use '$' for
a quadradic operator, return different values for <, =, >.
i.e.  n = (a$b : less() : equal() : greater());

I don't think I'm serious...
-- 
	-bill davidsen

  ihnp4!seismo!rochester!steinmetz!--\
                                       \
                    unirot ------------->---> crdos1!davidsen
                          chinet ------/
         sixhub ---------------------/        (davidsen at ge-crd.ARPA)

"Stupidity, like virtue, is its own reward"



More information about the Comp.lang.c mailing list