Write Programs That Write Programs

Writing programs that write other programs, also called "metaprogramming," is a useful technique in generating specialized and optimized code.

    
Generate C code that adds the number 2 to any data type:
In[3]:=
Click for copyable input
Out[5]=
New to Mathematica? Find your learning path »
Have a question? Ask support »