V

Reflection and Metaprogramming

We have seen styles that use functions, procedures and objects; we have also seen functions and objects being passed around and stored in variables, as regular data values. However, these programs are blind tools: we see them, and they interact with us via input/output, but they don't see themselves. This part of the book contains a few styles related to the use of computational reflection and metaprogramming. Reflection is about programs being somehow aware of themselves. Metaprogramming is programming that involves the program accessing, and even changing, itself as it executes. Besides its geeky appeal, metaprogramming can be very useful for engineering software systems that evolve over time.

Reflection falls into the category of programming concepts that are too powerful for their own sake, and that, therefore, should be used with great care. However, many modern composition techniques would not be possible without it.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset