tags:

views:

108

answers:

1

I'm writing code in C++, but I really like K/APL's array-oriented style.

Does anyone know of a good set of operator overloading tricks / macros / ... to allow some K/APL -style programming in C++?

Thanks!

+1  A: 

I haven't looked specifically at K/APL, but depending on your viewpoint, you could argue that some of the operator overloads provided by std::valarray are vaguely similar to APL. With its support for Universal Character names, you could (at least in theory) even provide APL-like names for some of them.

That still leaves some characteristics that aren't like APL at all, such as operators in C++ having precedence and associativity, which APL operators don't at all (at least if memory serves).

Jerry Coffin