Use this tag for all questions about teaching the concept of metaprogramming. Metaprogramming is the idea that a program creates or modifies a program, sometimes the executing program itself. Note that program reflection is a weaker concept in which a running program learns things about itself.

Metaprogramming is the concept that a program creates a program. That doesn't mean "creates text that can be compiled" but creates a running program itself. It is a completely natural concept in Lisp and its derivatives since there is no real distinction there between code and data.

Ruby provides full support for metaprogramming as do some other object-oriented languages. Java provides poor support for the idea. Note that metaprogramming is a deeper concept than program reflection: getting information about the running program from within it.