Talk:Reflective programming: Difference between revisions

Content deleted Content added
Line 25:
 
:I don't think that reflection is self-modifing code, they are two different things. With reflection, code does not change at runtime at all, it's only introspection, code knows about itself, but does not change at all. You could do reflection even in C (but it's not portalbe), as you can call functions via pointers, and you could search for the required pointer to be called by browsing through the debug symbol database for example. But the article DOES make confusion betweek reflection, that is, knowing itself, with self-modification, that is an entirely different concept! Most languages that support reflection do not support self-modification. IMHO the article is all wrong in this respect! AND there are some self-modifing languages where you can't query for the type of an object and thus, they don't have reflection. - AngeloPesce, Jan 2008
 
:Reflection is not just introspection. Reflection may be divided in two major areas: introspection and intercession. Self-modifing code is a form of intercession as as such is a form of reflection. - Vieira, Jun 2012
 
:Also every example there that uses code interpretation (that still is NOT QUITE full self-modifing code, because you're just invoking the interpreter to parse more text, but you are not allowed to modify existing code, or at least, not easily, that's something that is only doable in ASM or in languages that have code-as-data equivalence, like LISP) are _plain wrong_. There you don't have reflection, you are not allowed to know the type given a string, to query the interpreter database... you're only hacking the function call by interpreting it in runtime, instead of having it hardcoded. It's not, conceptually, the same thing. For example, if I have an interpreted language that makes me interpret strings in runtime, I surely can call methods given the string of the class and of the method, but still is not quite the same thing as getting the type object via a string. IMHO those examples are only confusing, and are one of the typical Wikipedia problems, users add everything just to add things to the article, even if the examples are not useful to clarify the concept, and rather they make it harder to be understood. This is really bad. - AngeloPesce, Jan 2008, '''please consider deleting those examples'''