Top "Metaprogramming" questions

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

Ruby String to Class Name

I am trying to create a new class to that will inherit from ActiveRecord::Base the class needs to be …

ruby metaprogramming
Is it possible to figure out the parameter type and return type of a lambda?

Given a lambda, is it possible to figure out it's parameter type and return type? If yes, how? Basically, I …

c++ lambda metaprogramming c++11 traits
Find classes available in a Module

I have a module MyModule. I dynamically load classes into it. How can I get a list of the classes …

ruby metaprogramming
Dynamic method calling in Ruby

As far as I am aware there are three ways to dynamically call a method in Ruby: Method 1: s = SomeObject.…

ruby metaprogramming dynamic-method
define_method: How to dynamically create methods with arguments

I want to create a bunch of methods for a find_by feature. I don't want to write the same …

ruby metaprogramming
Is metaprogramming possible in C#?

In particular, would it be possible to have code similar to this c++ code executed at compile time in c#? …

c# metaprogramming
Does C++ support compile-time counters?

For the purpose of introspection, sometimes I've wanted to automatically assign serial numbers to types, or something similar. Unfortunately, template …

c++ templates metaprogramming state
Enumerate over an enum in C++

In C++, Is it possible to enumerate over an enum (either runtime or compile time (preferred)) and call functions/generate …

c++ enums metaprogramming enumeration
Python decorator makes function forget that it belongs to a class

I am trying to write a decorator to do logging: def logger(myFunc): def new(*args, **keyargs): print 'Entering %s.%…

python reflection metaprogramming
Valid characters in a python class name

I'm dynamically creating python classes, and I know not all characters are valid in this context. Is there a method …

python metaprogramming