Friday, June 10, 2011

No No No No

// Note: The following is all standard-conforming C++, this is not a hypothetical language extension.
 assert( top( o-------o
|L \
| L \
| o-------o
| ! !
! ! !
o | !
L | !
L| !
o-------o ) == ( o-------o
| !
! !
o-------o ) );

Multi-Dimensional Analog Literals

2 comments:

  1. Of course, you can accomplish the same thing in Lisp as a trivial macro "shape"

    (assert (= (top (shape ...etc...)) (shape ...etc...)))

    ReplyDelete
  2. It may be legal, but it's not complete:

    $ make nononono
    g++ nononono.cpp -o nononono
    nononono.cpp:1: error: expected constructor, destructor, or type conversion before '(' token
    nononono.cpp:1: error: expected `,' or `;' before '(' token
    make: *** [nononono] Error 1

    But you probably already knew that.

    ReplyDelete

Real names (or handles), please. Anonymous comments are likely to be ignored.