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:

Aaron said...

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

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

rdm said...

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.