Top "Metaprogramming" questions

Metaprogramming is the capability to reprogram ones programming environment, as with macros or metaclasses.

`respond_to?` vs. `respond_to_missing?`

What is the point of defining respond_to_missing? as opposed to defining respond_to?? What goes wrong if you …

ruby metaprogramming
How do I get a list of files that have been `required` in Ruby?

This is purely an experiment, but I'm wondering if it's possible to get a list of the require'd gems at …

ruby rubygems metaprogramming
Tag dispatch versus static methods on partially specialised classes

Suppose I want to write a generic function void f<T>(), which does one thing if T is …

c++ metaprogramming generic-programming partial-specialization
C++ Template Metaprogramming - Is it possible to output the generated code?

I would like to debug some templated code to understand it better. Unfortunately I'm new to template metaprogramming and it …

c++ templates metaprogramming seqan
What are the coolest examples of metaprogramming that you've seen in C++?

What are the coolest examples of metaprogramming that you've seen in C++? What are some practical uses of metaprogramming that …

c++ templates metaprogramming template-meta-programming
Can you nest C preprocessor directives?

For instance, is the following possible: #define definer(x) #define #x?

metaprogramming c-preprocessor preprocessor-directive
Get locals from calling namespace in Python

I want to retrieve the local variables from Python from a called function. Is there any way to do this? …

python metaprogramming
Ruby - ArgumentError: wrong number of arguments (2 for 1)

I have the following class overwrite: class Numeric @@currencies = {:dollar => 1, :yen => 0.013, :euro => 1.292, :rupee => 0.019} def method_missing(…

ruby metaprogramming numeric method-missing
Encrypting / obfuscating a string literal at compile-time

I want to encrypt/encode a string at compile time so that the original string does not appear in the …

c++ string templates metaprogramming compile-time
C++ metafunction to determine whether a type is callable

Is it possible to write a C++(0x) metafunction that determines whether a type is callable? By callable type I …

c++ c++11 metaprogramming