Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

This is pretty much the same as @synthesize in Objective-C.

I think a better example of metaprogramming might be the usage of method_missing in Ruby, or, say, __call and __callStatic in PHP, which all allow one to do interesting things with non-existent method invocations.



I'd argue that method_missing isn't metaprogramming at all.

What about ActiveRecord (Rails' default ORM)? That makes great use of code-writing-code to generate a ton of methods on your class all based on db fields.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: