Note that there are some explanatory texts on larger screens.

plurals
  1. POWhat _did_ the C operators /\ and \/ do?
    text
    copied!<p>Anyone can "declare" ones own operators in C.... that is if one is a C compiler guru and has the source code to the C compiler! ;-)</p> <p>Further questions to puzzle:</p> <ol start="5"> <li>How are these operations done in C99? gcc? ...</li> <li>And why were /\ &amp; \/ dropped?</li> <li>Which types were the /\ and \/ operators valid for?</li> </ol> <p>Googling for "/\ \/" naturally returns nothing. Wikipedia has a page for neither /\ nor \/. But I have spotted form similar operators are built into the XML character entities! <HR><i>Source added:</i> I found the offending example in the PDP's cc source file "c00.c":</p> <pre><code>/* * Return the next symbol from the input. * peeksym is a pushed-back symbol, peekc is a pushed-back * character (after peeksym). * mosflg means that the next symbol, if an identifier, * is a member of structure or a structure tag or an enum tag */ symbol() { ... case BSLASH: if (subseq('/', 0, 1)) return(MAX); goto unkn; case DIVIDE: if (subseq('\\', 0, 1)) return(MIN); if (subseq('*',1,0)) return(DIVIDE); ... } </code></pre> <p><hr> <i>Actual Implementations:</i> The /\ and \/ operators date back as far as <a href="http://en.wikipedia.org/wiki/Sixth_Edition_Unix" rel="nofollow noreferrer">Sixth Edition Unix</a> 1975 (so far). Examples: <a href="http://www.bitsavers.org/bits/Interdata/32bit/unix/univWollongong_v6/interdata_v6/usr/source/c/c00.c" rel="nofollow noreferrer">Unix V6</a>(1975), <a href="http://stuff.mit.edu/afs/sipb/project/v7unix/fs/usr/src/cmd/c/c00.c" rel="nofollow noreferrer">Unix V7</a>(1979) and more currently <a href="http://ftp.gcu.info/tuhs/PDP-11/Trees/2.11BSD/usr/src/lib/ccom/c00.c" rel="nofollow noreferrer">BSD 2.11</a>(1992-<a href="http://en.wikipedia.org/wiki/Berkeley_Software_Distribution#cite_note-2.11bsd-0" rel="nofollow noreferrer">2008</a>)</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload