Top "Metaprogramming" questions

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

method_missing gotchas in Ruby

Are there any things to be careful about when defining the method_missing method in Ruby? I'm wondering whether there …

ruby metaprogramming
Thread Safety: Class Variables in Ruby

Performing writes/reads on class variables in Ruby is not thread safe. Performing writes/reads on instance variables appears to …

ruby multithreading thread-safety metaprogramming ruby-1.9.2
How to calculate offset of a class member at compile time?

Given a class definition in C++ class A { public: //methods definition .... private: int i; char *str; .... } Is it possible to …

c++ templates metaprogramming offset member
Ruby - Using class_eval to define methods

I'm doing the SaaS Stanford class, trying to do Part 5 of this assignment I'm having a really hard time grasping …

ruby metaprogramming class-eval
Ruby metaprogramming online tutorial

I have just started to learn Ruby and got a good take on the basics. I keep hearing that one …

ruby metaprogramming
What's the use of metaprogramming?

I've read: Wikipedia Code Generation vs. Metaprogramming The art of Metaprogramming Metaprogramming at c2.com and I confess some confusion …

language-agnostic code-generation metaprogramming
How to call a method dynamically in Elixir, by specifying both module and method name?

I'd like to know what exactly a method name is in elixir: array = [1,2,3] module_name = :lists method_name = :nth # this …

erlang metaprogramming elixir
How do I call +class methods in Objective C without referencing the class?

I have a series of "policy" objects which I thought would be convenient to implement as class methods on a …

objective-c metaprogramming class-method
Compile time sizeof_array without using a macro

This is just something that has bothered me for the last couple of days, I don't think it's possible to …

c++ metaprogramming puzzle
Automatically setting an enum member's value to its name

I've been messing around with python's enum library and have come across a conundrum. In the docs, they show an …

python enums metaprogramming metaclass