Gregory Brown wrote:
> On 1/8/06, James Edward Gray II <james / grayproductions.net> wrote:
> 
> 
>>>This is definitely a point worth making, that *most* people know that
>>>meta-programming is dangerous stuff
>>
>>If you are compiling this information for a written piece, I suggest
>>beginning with some definitions.  I do not consider the above example
>>metaprogramming, for example, just a violation of encapsulation.  :)
> 
> 
> Well that depends on who put the secret value there, doesn't it? ;)
> 
> But good point.  How would you (the community) define
> meta-programming, open class system, and the dynamic nature of ruby?

An element (the key element?) of meta-programming is the creation or 
modification of methods, classes, and modules based on runtime 
information.  I.e. run-time introduction of new behavior.

So, as JEGII pointed  out, merely bypassing encapsulation is not 
metaprogramming by this (rough) definition.


But the means of introducing new behavior needs some examination; I can 
think of ways of adding new behavior that probably wouldn't strike many 
people as examples of metaprogramming.


James

"One man's meta is another man's poison."
    or
"I never meta program I didn't like."

(I'm getting flashbacks of Whatsamatta U.  Paging Jay Ward ...)

-- 

http://www.ruby-doc.org       - Ruby Help & Documentation
http://www.artima.com/rubycs/ - Ruby Code & Style: Writers wanted
http://www.rubystuff.com      - The Ruby Store for Ruby Stuff
http://www.jamesbritt.com     - Playing with Better Toys
http://www.30secondrule.com   - Building Better Tools