Heretical template syntax proposal

Bill Baxter wbaxter at gmail.com
Wed Oct 22 22:39:05 PDT 2008


Sorry for the second reply to self, but I got curious about where the
[] came from.
Here's an interesting doc on the history of C I found:
   http://cm.bell-labs.com/cm/cs/who/dmr/chist.pdf

There it mentions:
"""
By a general rule, in B the expression
  *(V+i)
adds V and i, and refers to the ith location after V. Both BCPL and B
each add special notation
to sweeten such array accesses; in B an equivalent expression is

   V[i]

and in BCPL

   V!i

This approach to arrays was unusual even at the time; C would later
assimilate it in an even less
conventional way.
"""

Interesting to see our friend the ! pop up again in an unusual place
in the history of C.

--bb



More information about the Digitalmars-d mailing list