em**********@kinglibrary.net wrote:
I'm working on a program which has a strange operator, :>. This is
the syntax:
((unsigned short)( var1)):>((void __near *)( var2 ))
Any clue?
:is an alternate spelling of ] , one that can be used
even with a keyboard that lacks the ] character. The complete
list of these "digraphs" is
<: [
: ]
<% {
% }
%: #
%:%: ##
The underlying problem is that traditional C source uses
characters that are not in the "invariant subset" of the
ISO/IEC 646 character set standard; some of C's characters
are used for other purposes in local character sets. The
digraphs provide ways to spell C operators that use "variant"
characters, even on keyboards that have a Yen sign, say,
rather than one of the characters C source uses.
The odd thing is that this same problem has also been
addressed in another way, through the use of *tri*graphs:
??= #
??( [
??/ \
??) ]
??' ^
??< {
??! |
?? }
??- ~
.... which have been around since the original ANSI C Standard
and still work. Indeed, the digraphs only work in "open code"
and not in string literals and character constants:
#include <stdio.h /* these */
%:include <stdio.h /* are */
??=include <stdio.h /* equivalent */
but
puts ("#"); /* prints octothorpe */
puts ("??="); /* prints octothorpe */
puts ("%:"); /* prints percent and colon */
As far as I can see, the digraphs don't add anything that wasn't
already possible with trigraphs (or with the original large set
of C source characters, of course), but seem to have been added
just because they're thought to be more readable.
The practical value is that you can amaze your friends with
things like
%:include <stdio.h>
int main(void)
<%
printf ("O brave new world!??/n");
return 0;
??>
--
Er*********@sun.com