title: Is metaprogramming a subset of reflection?
body: <p>I used to think that metaprogramming involved modifying the program, and (as do some answers to <a href="https://stackoverflow.com/questions/37628/what-is-reflection-and-why-is-it-useful">What is reflection and why is it useful?</a> ) that reflection merely consisted of introspection of a program. However, the reflection tag wiki says</p>
  
  <blockquote>
    <p>Reflection is the process by which a program can observe and
    <strong>modify</strong> its own structure and behavior at runtime.</p>
    
    <p>Reflection is the process by which a program can perform
    introspection. This introspection usually involves the ability to
    observe and <strong>modify</strong> its own structure and behavior at runtime. From
    theoretical perspective reflection relates to the fact that program
    instructions are stored as data. The distinction between program code
    and data is a matter of how the information is treated. Hence programs
    can treat their own code as data and observe or <strong>modify</strong> them.</p>
  </blockquote>
  
  <p>[emphasis added]</p>
  
  <p>And the description for metaprogramming is </p>
  
  <blockquote>
    <p>Metaprogramming is writing programs that write or manipulate other
    programs as their data.</p>
    
    <p>Metaprogramming is useful because it can save programmers valuable
    time. Some languages have support to metaprogram themselves and this
    allows to create code with great expressive power.</p>
  </blockquote>
  
  <p>(I assume that "write" doesn't mean writing source code to a file, because that'd be code generation.)</p>
  
  <p>Would this make metaprogramming merely a subset of reflection?</p>
  
  <p>Or are the terms distinct because some programming languages are metaprogrammed by another language, in which case metaprogramming occurs but not reflection? (There was a single uncited sentence claiming this in the <a href="http://en.wikipedia.org/wiki/Metaprogramming" rel="noreferrer">metaprogramming Wikipedia article</a>)</p>
  
  <p>Or do the terms "reflection" and "metaprogramming" get used differently depending on what programming language the person is using?</p>