<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.sarg.dev/index.php?action=history&amp;feed=atom&amp;title=Reflective_programming</id>
	<title>Reflective programming - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.sarg.dev/index.php?action=history&amp;feed=atom&amp;title=Reflective_programming"/>
	<link rel="alternate" type="text/html" href="https://wiki.sarg.dev/index.php?title=Reflective_programming&amp;action=history"/>
	<updated>2026-04-18T04:14:11Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.44.2</generator>
	<entry>
		<id>https://wiki.sarg.dev/index.php?title=Reflective_programming&amp;diff=202441&amp;oldid=prev</id>
		<title>~2025-34236-49: /* C */</title>
		<link rel="alternate" type="text/html" href="https://wiki.sarg.dev/index.php?title=Reflective_programming&amp;diff=202441&amp;oldid=prev"/>
		<updated>2025-11-18T00:40:08Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;C&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Short description|Ability of a process to examine and modify itself}}&lt;br /&gt;
{{distinguish|Reflection (computer graphics)}}&lt;br /&gt;
&lt;br /&gt;
In [[computer science]], &amp;#039;&amp;#039;&amp;#039;reflective programming&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;reflection&amp;#039;&amp;#039;&amp;#039; is the ability of a [[Process (computing)|process]] to examine, [[Introspection (computer science)|introspect]], and modify its own structure and behavior.&amp;lt;ref&amp;gt;{{Citation | title = A Tutorial on Behavioral Reflection and its Implementation by Jacques Malenfant et al. | publisher = unknown | url = http://www2.parc.com/csl/groups/sda/projects/reflection96/docs/malenfant/malenfant.pdf | access-date = 23 June 2019 | archive-url = https://web.archive.org/web/20170821214626/http://www2.parc.com/csl/groups/sda/projects/reflection96/docs/malenfant/malenfant.pdf | archive-date = 21 August 2017 }}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Historical background==&lt;br /&gt;
The earliest computers were programmed in their native [[assembly language]]s, which were inherently reflective, as these original architectures could be programmed by defining instructions as data and using [[self-modifying code]]. As the bulk of programming moved to higher-level [[compiled languages]] such as [[ALGOL]], [[COBOL]], [[Fortran]], [[Pascal (programming language)|Pascal]], and [[C (programming language)|C]], this reflective ability largely disappeared until new programming languages with reflection built into their type systems appeared.{{Citation needed|date=July 2015}}&lt;br /&gt;
&lt;br /&gt;
[[Brian Cantwell Smith]]&amp;#039;s 1982 doctoral dissertation introduced the notion of computational reflection in procedural [[programming languages]] and the notion of the [[meta-circular interpreter]] as a component of 3-Lisp.&amp;lt;ref&amp;gt;Brian Cantwell Smith, [http://hdl.handle.net/1721.1/15961 Procedural Reflection in Programming Languages], Department of Electrical Engineering and Computer Science, Massachusetts Institute of Technology, PhD dissertation, 1982.&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;Brian C. Smith. [http://publications.csail.mit.edu/lcs/specpub.php?id=840 Reflection and semantics in a procedural language] {{Webarchive|url=https://web.archive.org/web/20151213034343/http://publications.csail.mit.edu/lcs/specpub.php?id=840 |date=2015-12-13 }}. Technical Report MIT-LCS-TR-272, Massachusetts Institute of Technology, Cambridge, Massachusetts, January 1982.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Uses==&lt;br /&gt;
Reflection helps programmers make generic software libraries to display data, process different formats of data, perform [[serialization]] and deserialization of data for communication, or do bundling and unbundling of data for containers or bursts of communication.&lt;br /&gt;
&lt;br /&gt;
Effective use of reflection almost always requires a plan: A design framework, encoding description, object library, a map of a database or entity relations.&lt;br /&gt;
&lt;br /&gt;
Reflection makes a language more suited to network-oriented code. For example, it assists languages such as [[Java (programming language)|Java]] to operate well in networks by enabling libraries for serialization, bundling and varying data formats. Languages without reflection such as [[C (programming language)|C]] are required to use auxiliary compilers for tasks like [[Abstract Syntax Notation]] to produce code for serialization and bundling.&lt;br /&gt;
&lt;br /&gt;
Reflection can be used for observing and modifying program execution at [[Runtime (program lifecycle phase)|runtime]]. A reflection-oriented program component can monitor the execution of an enclosure of code and can modify itself according to a desired goal of that enclosure. This is typically accomplished by dynamically assigning program code at runtime.&lt;br /&gt;
&lt;br /&gt;
In [[object-oriented programming]] languages such as [[Java (programming language)|Java]], reflection allows &amp;#039;&amp;#039;inspection&amp;#039;&amp;#039; of classes, interfaces, fields and methods at runtime without knowing the names of the interfaces, fields, methods at [[compile time]]. It also allows &amp;#039;&amp;#039;instantiation&amp;#039;&amp;#039; of new objects and &amp;#039;&amp;#039;invocation&amp;#039;&amp;#039; of methods.&lt;br /&gt;
&lt;br /&gt;
Reflection is often used as part of [[software testing]], such as for the runtime creation/instantiation of [[mock object]]s.&lt;br /&gt;
&lt;br /&gt;
Reflection is also a key strategy for [[metaprogramming]].&lt;br /&gt;
&lt;br /&gt;
In some object-oriented programming languages such as [[C Sharp (programming language)|C#]] and [[Java (programming language)|Java]], reflection can be used to bypass [[member accessibility]] rules. For C#-properties this can be achieved by writing directly onto the (usually invisible) backing field of a non-public property. It is also possible to find non-public methods of classes and types and manually invoke them. This works for project-internal files as well as external libraries such as [[.NET Framework|.NET]]&amp;#039;s assemblies and Java&amp;#039;s archives.&lt;br /&gt;
&lt;br /&gt;
==Implementation==&lt;br /&gt;
{{Unreferenced section|date=January 2008}}&lt;br /&gt;
A language that supports reflection provides a number of features available at runtime that would otherwise be difficult to accomplish in a lower-level language. Some of these features are the abilities to:&lt;br /&gt;
* Discover and modify [[Source code|source-code]] constructions (such as code blocks, [[Class (computer science)|classes]], methods, protocols, etc.) as [[first-class object]]s at [[Runtime (program lifecycle phase)|runtime]].&lt;br /&gt;
* Convert a [[string (computer science)|string]] matching the symbolic name of a class or function into a reference to or invocation of that class or function.&lt;br /&gt;
* Evaluate a string as if it were a source-code statement at runtime.&lt;br /&gt;
* Create a new [[Interpreter (computing)|interpreter]] for the language&amp;#039;s [[bytecode]] to give a new meaning or purpose for a programming construct.&lt;br /&gt;
&lt;br /&gt;
These features can be implemented in different ways. In [[MOO (programming language)|MOO]], reflection forms a natural part of everyday programming idiom. When verbs (methods) are called, various variables such as &amp;#039;&amp;#039;verb&amp;#039;&amp;#039; (the name of the verb being called) and &amp;#039;&amp;#039;this&amp;#039;&amp;#039; (the object on which the verb is called) are populated to give the context of the call. Security is typically managed by accessing the caller stack programmatically: Since &amp;#039;&amp;#039;callers&amp;#039;&amp;#039;() is a list of the methods by which the current verb was eventually called, performing tests on &amp;#039;&amp;#039;callers&amp;#039;&amp;#039;()[0] (the command invoked by the original user) allows the verb to protect itself against unauthorised use.&lt;br /&gt;
&lt;br /&gt;
Compiled languages rely on their runtime system to provide information about the source code. A compiled [[Objective-C]] executable, for example, records the names of all methods in a block of the executable, providing a table to correspond these with the underlying methods (or selectors for these methods) compiled into the program. In a compiled language that supports runtime creation of functions, such as [[Common Lisp]], the runtime environment must include a compiler or an interpreter.&lt;br /&gt;
&lt;br /&gt;
Reflection can be implemented for languages without built-in reflection by using a [[program transformation]] system to define automated source-code changes.&lt;br /&gt;
&lt;br /&gt;
==Security considerations==&lt;br /&gt;
&lt;br /&gt;
Reflection may allow a user to create unexpected [[control flow]] paths through an application, potentially bypassing security measures. This may be exploited by attackers.&amp;lt;ref&amp;gt;{{cite report |first1=Paulo |last1=Barros |first2=René |last2=Just |first3=Suzanne |last3=Millstein |first4=Paul |last4=Vines |first5=Werner |last5=Dietl |first6=Marcelo |last6=d&amp;#039;Amorim |first7=Michael D. |last7=Ernst |date=August 2015 |title=Static Analysis of Implicit Control Flow: Resolving Java Reflection and Android Intents |url=https://homes.cs.washington.edu/~mernst/pubs/implicit-control-flow-tr150801.pdf |publisher=University of Washington |id=UW-CSE-15-08-01 |access-date=October 7, 2021 }}&amp;lt;/ref&amp;gt; Historical [[Vulnerability (computing)|vulnerabilities]] in Java caused by unsafe reflection allowed code retrieved from potentially untrusted remote machines to break out of the Java [[Sandbox (computer security)|sandbox]] security mechanism. A large scale study of 120 Java vulnerabilities in 2013 concluded that unsafe reflection is the most common vulnerability in Java, though not the most exploited.&amp;lt;ref&amp;gt;{{cite magazine |author=Eauvidoum, Ieu |author2=disk noise |date=October 5, 2021 |title=Twenty years of Escaping the Java Sandbox |url=http://phrack.org/issues/70/7.html#article |magazine=[[Phrack]] |volume=10 |issue=46 |access-date=October 7, 2021}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
The following code snippets create an [[instance (computer science)|instance]] {{code|foo}} of [[class (computer science)|class]] {{code|Foo}} and invoke its [[method (computer science)|method]] {{code|PrintHello}}. For each [[programming language]], normal and reflection-based call sequences are shown.&lt;br /&gt;
&lt;br /&gt;
=== Common Lisp ===&lt;br /&gt;
The following is an example in [[Common Lisp]] using the [[Common Lisp Object System]]:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lisp&amp;quot;&amp;gt;&lt;br /&gt;
(defclass foo () ())&lt;br /&gt;
(defmethod print-hello ((f foo)) (format T &amp;quot;Hello from ~S~%&amp;quot; f))&lt;br /&gt;
&lt;br /&gt;
;; Normal, without reflection&lt;br /&gt;
(let ((foo (make-instance &amp;#039;foo)))&lt;br /&gt;
  (print-hello foo))&lt;br /&gt;
&lt;br /&gt;
;; With reflection to look up the class named &amp;quot;foo&amp;quot; and the method&lt;br /&gt;
;; named &amp;quot;print-hello&amp;quot; that specializes on &amp;quot;foo&amp;quot;.&lt;br /&gt;
(let* ((foo-class (find-class (read-from-string &amp;quot;foo&amp;quot;)))&lt;br /&gt;
       (print-hello-method (find-method (symbol-function (read-from-string &amp;quot;print-hello&amp;quot;))&lt;br /&gt;
                                        nil (list foo-class))))&lt;br /&gt;
  (funcall (sb-mop:method-generic-function print-hello-method)&lt;br /&gt;
           (make-instance foo-class)))&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== C ===&lt;br /&gt;
Reflection is not possible in [[C (programming language)|C]], though parts of reflection can be emulated.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
#include &amp;lt;string.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
typedef struct {&lt;br /&gt;
    // ...&lt;br /&gt;
} Foo;&lt;br /&gt;
&lt;br /&gt;
typedef void (*Method)(void*);&lt;br /&gt;
&lt;br /&gt;
// The method: Foo::printHello&lt;br /&gt;
void Foo_printHello([[maybe_unused]] void* instance) {&lt;br /&gt;
    (void)instance; // Instance ignored for a static method&lt;br /&gt;
    printf(&amp;quot;Hello, world!\n&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Simulated method table&lt;br /&gt;
typedef struct {&lt;br /&gt;
    const char* name;&lt;br /&gt;
    Method fn;&lt;br /&gt;
} MethodEntry;&lt;br /&gt;
&lt;br /&gt;
MethodEntry fooMethods[] = {&lt;br /&gt;
    { &amp;quot;printHello&amp;quot;, Foo_printHello },&lt;br /&gt;
    { NULL, NULL } // Sentinel to mark end&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
// Simulate reflective method lookup&lt;br /&gt;
[[nodiscard]]&lt;br /&gt;
Method findMethodByName(const char* name) {&lt;br /&gt;
    for (size_t i = 0; fooMethods[i].name; i++) {&lt;br /&gt;
        if (strcmp(fooMethods[i].name, name) == 0) {&lt;br /&gt;
            return fooMethods[i].fn;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    return NULL;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int main() {&lt;br /&gt;
    // Without reflection&lt;br /&gt;
    Foo fooInstance;&lt;br /&gt;
    Foo_printHello(&amp;amp;fooInstance);&lt;br /&gt;
&lt;br /&gt;
    // With emulated reflection&lt;br /&gt;
    Foo* fooReflected = malloc(sizeof(Foo));&lt;br /&gt;
    if (!fooReflected) {&lt;br /&gt;
        fprintf(stderr, &amp;quot;Memory allocation failed\n&amp;quot;);&lt;br /&gt;
        return 1;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    const char* methodName = &amp;quot;printHello&amp;quot;;&lt;br /&gt;
    Method m = findMethodByName(methodName);&lt;br /&gt;
&lt;br /&gt;
    if (m) {&lt;br /&gt;
        m(fooReflected);&lt;br /&gt;
    } else {&lt;br /&gt;
        fprintf(stderr, &amp;quot;Method &amp;#039;%s&amp;#039; not found\n&amp;quot;, methodName);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    free(fooReflected);&lt;br /&gt;
    return 0;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== C++ ===&lt;br /&gt;
The following is an example in [[C++]] (using reflection added in [[C++26]]).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
import std;&lt;br /&gt;
&lt;br /&gt;
using std::string_view;&lt;br /&gt;
using std::vector;&lt;br /&gt;
using std::meta::access_context;&lt;br /&gt;
using std::meta::exception;&lt;br /&gt;
using std::meta::info;&lt;br /&gt;
using std::views::filter;&lt;br /&gt;
&lt;br /&gt;
[[nodiscard]]&lt;br /&gt;
consteval bool isNonstaticMethod(info mem) noexcept {&lt;br /&gt;
    return std::meta::is_class_member(mem) &lt;br /&gt;
        &amp;amp;&amp;amp; !std::meta::is_static_member(mem)&lt;br /&gt;
        &amp;amp;&amp;amp; std::meta::is_function(mem);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
[[nodiscard]]&lt;br /&gt;
consteval info findMethod(info ty, const char* name) {&lt;br /&gt;
    constexpr auto ctx = access_context::current();&lt;br /&gt;
    vector&amp;lt;info&amp;gt; members = std::meta::members_of(ty, ctx);&lt;br /&gt;
    for (info member : members | filter(isNonstaticMethod)) {&lt;br /&gt;
        if (std::meta::identifier_of(member) == name) {&lt;br /&gt;
            return member;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    throw exception(&amp;quot;Failed to retrieve method of M!&amp;quot;, ^^findMethod);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
template &amp;lt;info Ty, auto Name&amp;gt;&lt;br /&gt;
constexpr auto createInvokerImpl = []() -&amp;gt; auto {&lt;br /&gt;
    using Type = [: Ty :];&lt;br /&gt;
    static constexpr info M = findMethod(Ty, Name);&lt;br /&gt;
    static_assert(&lt;br /&gt;
        std::meta::parameters_of(M).size() == 0 &amp;amp;&amp;amp; &lt;br /&gt;
        std::meta::return_type_of(M) == ^^void&lt;br /&gt;
    );&lt;br /&gt;
    return [](Type&amp;amp; instance) -&amp;gt; void { instance.[: M :](); };&lt;br /&gt;
}();&lt;br /&gt;
&lt;br /&gt;
[[nodiscard]]&lt;br /&gt;
consteval info createInvoker(info ty, string_view name) {&lt;br /&gt;
    return std::meta::substitute(&lt;br /&gt;
        ^^createInvokerImpl, &lt;br /&gt;
        { std::meta::reflect_constant(ty), std::meta::reflect_constant_string(name) }&lt;br /&gt;
    );&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
class Foo {&lt;br /&gt;
private:&lt;br /&gt;
    // ...&lt;br /&gt;
public:&lt;br /&gt;
    Foo() = default;&lt;br /&gt;
&lt;br /&gt;
    void printHello() const noexcept {&lt;br /&gt;
        std::println(&amp;quot;Hello, world!&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
int main(int argc, char* argv[]) {&lt;br /&gt;
    Foo foo;&lt;br /&gt;
&lt;br /&gt;
    // Without reflection&lt;br /&gt;
    foo.printHello();&lt;br /&gt;
&lt;br /&gt;
    // With reflection&lt;br /&gt;
    auto invokePrint = [: createInvoker(^^Foo, &amp;quot;printHello&amp;quot;) :];&lt;br /&gt;
    invokePrint(foo);&lt;br /&gt;
&lt;br /&gt;
    return 0;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== C# ===&lt;br /&gt;
The following is an example in [[C Sharp (programming language)|C#]]:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c#&amp;quot;&amp;gt;&lt;br /&gt;
namespace Wikipedia.Examples;&lt;br /&gt;
&lt;br /&gt;
using System;&lt;br /&gt;
using System.Reflection;&lt;br /&gt;
&lt;br /&gt;
class Foo&lt;br /&gt;
{&lt;br /&gt;
    // ...&lt;br /&gt;
&lt;br /&gt;
    public Foo() {}&lt;br /&gt;
&lt;br /&gt;
    public void PrintHello()&lt;br /&gt;
    {&lt;br /&gt;
        Console.WriteLine(&amp;quot;Hello, world!&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
public class InvokeFooExample&lt;br /&gt;
{&lt;br /&gt;
    static void Main(string[] args)&lt;br /&gt;
    {&lt;br /&gt;
        // Without reflection&lt;br /&gt;
        Foo foo = new();&lt;br /&gt;
        foo.PrintHello();&lt;br /&gt;
&lt;br /&gt;
        // With reflection&lt;br /&gt;
        Object foo = Activator.CreateInstance(typeof(Foo));&lt;br /&gt;
        MethodInfo method = foo.GetType().GetMethod(&amp;quot;PrintHello&amp;quot;);&lt;br /&gt;
        method.Invoke(foo, null);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Delphi, Object Pascal===&lt;br /&gt;
This [[Delphi (software)|Delphi]] and [[Object Pascal]] example assumes that a {{mono|TFoo}} class has been declared in a unit called {{mono|Unit1}}:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;Delphi&amp;quot;&amp;gt;&lt;br /&gt;
uses RTTI, Unit1;&lt;br /&gt;
&lt;br /&gt;
procedure WithoutReflection;&lt;br /&gt;
var&lt;br /&gt;
  Foo: TFoo;&lt;br /&gt;
begin&lt;br /&gt;
  Foo := TFoo.Create;&lt;br /&gt;
  try&lt;br /&gt;
    Foo.Hello;&lt;br /&gt;
  finally&lt;br /&gt;
    Foo.Free;&lt;br /&gt;
  end;&lt;br /&gt;
end;&lt;br /&gt;
&lt;br /&gt;
procedure WithReflection;&lt;br /&gt;
var&lt;br /&gt;
  RttiContext: TRttiContext;&lt;br /&gt;
  RttiType: TRttiInstanceType;&lt;br /&gt;
  Foo: TObject;&lt;br /&gt;
begin&lt;br /&gt;
  RttiType := RttiContext.FindType(&amp;#039;Unit1.TFoo&amp;#039;) as TRttiInstanceType;&lt;br /&gt;
  Foo := RttiType.GetMethod(&amp;#039;Create&amp;#039;).Invoke(RttiType.MetaclassType, []).AsObject;&lt;br /&gt;
  try&lt;br /&gt;
    RttiType.GetMethod(&amp;#039;Hello&amp;#039;).Invoke(Foo, []);&lt;br /&gt;
  finally&lt;br /&gt;
    Foo.Free;&lt;br /&gt;
  end;&lt;br /&gt;
end;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===eC===&lt;br /&gt;
The following is an example in eC:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=eC&amp;gt;&lt;br /&gt;
// Without reflection&lt;br /&gt;
Foo foo{};&lt;br /&gt;
foo.hello();&lt;br /&gt;
&lt;br /&gt;
// With reflection&lt;br /&gt;
Class fooClass = eSystem_FindClass(__thisModule, &amp;quot;Foo&amp;quot;);&lt;br /&gt;
Instance foo = eInstance_New(fooClass);&lt;br /&gt;
Method m = eClass_FindMethod(fooClass, &amp;quot;hello&amp;quot;, fooClass.module);&lt;br /&gt;
((void(*)())(void*)m.function)(foo);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Go===&lt;br /&gt;
The following is an example in [[Go (programming language)|Go]]:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;go&amp;quot;&amp;gt;&lt;br /&gt;
import (&lt;br /&gt;
    &amp;quot;fmt&amp;quot;&lt;br /&gt;
    &amp;quot;reflect&amp;quot;&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
type Foo struct{}&lt;br /&gt;
&lt;br /&gt;
func (f Foo) Hello() {&lt;br /&gt;
    fmt.Println(&amp;quot;Hello, world!&amp;quot;)&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
func main() {&lt;br /&gt;
    // Without reflection&lt;br /&gt;
    var f Foo&lt;br /&gt;
    f.Hello()&lt;br /&gt;
&lt;br /&gt;
    // With reflection&lt;br /&gt;
    var fT reflect.Type = reflect.TypeOf(Foo{})&lt;br /&gt;
    var fV reflect.Value = reflect.New(fT)&lt;br /&gt;
&lt;br /&gt;
    var m reflect.Value = fV.MethodByName(&amp;quot;Hello&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    if m.IsValid() {&lt;br /&gt;
        m.Call(nil)&lt;br /&gt;
    } else {&lt;br /&gt;
        fmt.Println(&amp;quot;Method not found&amp;quot;)&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Java===&lt;br /&gt;
The following is an example in [[Java (programming language)|Java]]:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
package org.wikipedia.example;&lt;br /&gt;
&lt;br /&gt;
import java.lang.reflect.Method;&lt;br /&gt;
&lt;br /&gt;
class Foo {&lt;br /&gt;
    // ...&lt;br /&gt;
    public Foo() {}&lt;br /&gt;
&lt;br /&gt;
    public void printHello() {&lt;br /&gt;
       System.out.println(&amp;quot;Hello, world!&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
public class InvokeFooExample {&lt;br /&gt;
    public static void main(String[] args) {&lt;br /&gt;
        // Without reflection&lt;br /&gt;
        Foo foo = new Foo();&lt;br /&gt;
        foo.printHello();&lt;br /&gt;
&lt;br /&gt;
        // With reflection&lt;br /&gt;
        try {&lt;br /&gt;
            Foo foo = Foo.class.getDeclaredConstructor().newInstance();&lt;br /&gt;
&lt;br /&gt;
            Method m = foo.getClass().getDeclaredMethod(&amp;quot;printHello&amp;quot;, new Class&amp;lt;?&amp;gt;[0]);&lt;br /&gt;
            m.invoke(foo);&lt;br /&gt;
        } catch (ReflectiveOperationException e) {&lt;br /&gt;
            System.err.printf(&amp;quot;An error occurred: %s%n&amp;quot;, e.getMessage());&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Java also provides an internal class (not officially in the [[Java Class Library]]) in [[Java Platform Module System|module]] &amp;lt;code&amp;gt;jdk.unsupported&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;sun.reflect.Reflection&amp;lt;/code&amp;gt; which is used by [[Security of the Java software platform#The sun.misc.Unsafe class|&amp;lt;code&amp;gt;sun.misc.Unsafe&amp;lt;/code&amp;gt;]]. It contains one method, {{java|static Class&amp;lt;?&amp;gt; getCallerClass(int depth)}} for obtaining the class making a call at a specified depth.&amp;lt;ref&amp;gt;{{Cite web|title=Reflection (Java Platform SE 9)|url=https://cr.openjdk.org/~jjg/java-javafx-jdk-docs/api/sun/reflect/Reflection.html|publisher=OpenJDK|website=cr.openjdk.org|access-date=10 October 2025}}&amp;lt;/ref&amp;gt; This is now superseded by using the class &amp;lt;code&amp;gt;java.lang.StackWalker.StackFrame&amp;lt;/code&amp;gt; and its method {{java|Class&amp;lt;?&amp;gt; getDeclaringClass()}}.&lt;br /&gt;
&lt;br /&gt;
===JavaScript/TypeScript===&lt;br /&gt;
The following is an example in [[JavaScript]]:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
import &amp;#039;reflect-metadata&amp;#039;;&lt;br /&gt;
&lt;br /&gt;
// Without reflection&lt;br /&gt;
const foo = new Foo();&lt;br /&gt;
foo.hello();&lt;br /&gt;
&lt;br /&gt;
// With reflection&lt;br /&gt;
const foo = Reflect.construct(Foo);&lt;br /&gt;
const hello = Reflect.get(foo, &amp;#039;hello&amp;#039;);&lt;br /&gt;
Reflect.apply(hello, foo, []);&lt;br /&gt;
&lt;br /&gt;
// With eval&lt;br /&gt;
eval(&amp;#039;new Foo().hello()&amp;#039;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following is the same example in [[TypeScript]]:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;typescript&amp;quot;&amp;gt;&lt;br /&gt;
import &amp;#039;reflect-metadata&amp;#039;;&lt;br /&gt;
&lt;br /&gt;
// Without reflection&lt;br /&gt;
const foo: Foo = new Foo();&lt;br /&gt;
foo.hello();&lt;br /&gt;
&lt;br /&gt;
// With reflection&lt;br /&gt;
const foo: Foo = Reflect.construct(Foo);&lt;br /&gt;
const hello: (this: Foo) =&amp;gt; void = Reflect.get(foo, &amp;#039;hello&amp;#039;) as (this: Foo) =&amp;gt; void;&lt;br /&gt;
Reflect.apply(hello, foo, []);&lt;br /&gt;
&lt;br /&gt;
// With eval&lt;br /&gt;
eval(&amp;#039;new Foo().hello()&amp;#039;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Julia===&lt;br /&gt;
The following is an example in [[Julia (programming language)|Julia]]:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;julia-repl&amp;quot;&amp;gt;&lt;br /&gt;
julia&amp;gt; struct Point&lt;br /&gt;
           x::Int&lt;br /&gt;
           y&lt;br /&gt;
       end&lt;br /&gt;
&lt;br /&gt;
# Inspection with reflection&lt;br /&gt;
julia&amp;gt; fieldnames(Point)&lt;br /&gt;
(:x, :y)&lt;br /&gt;
&lt;br /&gt;
julia&amp;gt; fieldtypes(Point)&lt;br /&gt;
(Int64, Any)&lt;br /&gt;
&lt;br /&gt;
julia&amp;gt; p = Point(3,4)&lt;br /&gt;
&lt;br /&gt;
# Access with reflection&lt;br /&gt;
julia&amp;gt; getfield(p, :x)&lt;br /&gt;
3&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Objective-C===&lt;br /&gt;
The following is an example in [[Objective-C]], implying either the [[OpenStep]] or [[Foundation Kit]] framework is used:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;ObjC&amp;quot;&amp;gt;&lt;br /&gt;
// Foo class.&lt;br /&gt;
@interface Foo : NSObject&lt;br /&gt;
- (void)hello;&lt;br /&gt;
@end&lt;br /&gt;
&lt;br /&gt;
// Sending &amp;quot;hello&amp;quot; to a Foo instance without reflection.&lt;br /&gt;
Foo* obj = [[Foo alloc] init];&lt;br /&gt;
[obj hello];&lt;br /&gt;
&lt;br /&gt;
// Sending &amp;quot;hello&amp;quot; to a Foo instance with reflection.&lt;br /&gt;
id obj = [[NSClassFromString(@&amp;quot;Foo&amp;quot;) alloc] init];&lt;br /&gt;
[obj performSelector: @selector(hello)];&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Perl===&lt;br /&gt;
The following is an example in [[Perl]]:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;perl&amp;quot;&amp;gt;&lt;br /&gt;
# Without reflection&lt;br /&gt;
my $foo = Foo-&amp;gt;new;&lt;br /&gt;
$foo-&amp;gt;hello;&lt;br /&gt;
&lt;br /&gt;
# or&lt;br /&gt;
Foo-&amp;gt;new-&amp;gt;hello;&lt;br /&gt;
&lt;br /&gt;
# With reflection&lt;br /&gt;
my $class = &amp;quot;Foo&amp;quot;&lt;br /&gt;
my $constructor = &amp;quot;new&amp;quot;;&lt;br /&gt;
my $method = &amp;quot;hello&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
my $f = $class-&amp;gt;$constructor;&lt;br /&gt;
$f-&amp;gt;$method;&lt;br /&gt;
&lt;br /&gt;
# or&lt;br /&gt;
$class-&amp;gt;$constructor-&amp;gt;$method;&lt;br /&gt;
&lt;br /&gt;
# with eval&lt;br /&gt;
eval &amp;quot;new Foo-&amp;gt;hello;&amp;quot;;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===PHP===&lt;br /&gt;
The following is an example in [[PHP]]:&amp;lt;ref&amp;gt;{{cite web |title=PHP: ReflectionClass - Manual |url=https://www.php.net/manual/en/class.reflectionclass.php |website=www.php.net}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
// Without reflection&lt;br /&gt;
$foo = new Foo();&lt;br /&gt;
$foo-&amp;gt;hello();&lt;br /&gt;
&lt;br /&gt;
// With reflection, using Reflections API&lt;br /&gt;
$reflector = new ReflectionClass(&amp;quot;Foo&amp;quot;);&lt;br /&gt;
$foo = $reflector-&amp;gt;newInstance();&lt;br /&gt;
$hello = $reflector-&amp;gt;getMethod(&amp;quot;hello&amp;quot;);&lt;br /&gt;
$hello-&amp;gt;invoke($foo);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Python===&lt;br /&gt;
The following is an example in [[Python (programming language)|Python]]:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
from typing import Any&lt;br /&gt;
&lt;br /&gt;
class Foo:&lt;br /&gt;
    # ...&lt;br /&gt;
    def print_hello() -&amp;gt; None:&lt;br /&gt;
        print(&amp;quot;Hello, world!&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
    # Without reflection&lt;br /&gt;
    obj: Foo = Foo()&lt;br /&gt;
    obj.print_hello()&lt;br /&gt;
&lt;br /&gt;
    # With reflection&lt;br /&gt;
    obj: Foo = globals()[&amp;quot;Foo&amp;quot;]()&lt;br /&gt;
    _: Any = getattr(obj, &amp;quot;print_hello&amp;quot;)()&lt;br /&gt;
&lt;br /&gt;
    # With eval&lt;br /&gt;
    eval(&amp;quot;Foo().print_hello()&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===R===&lt;br /&gt;
The following is an example in [[R (programming language)|R]]:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;r&amp;quot;&amp;gt;&lt;br /&gt;
# Without reflection, assuming foo() returns an S3-type object that has method &amp;quot;hello&amp;quot;&lt;br /&gt;
obj &amp;lt;- foo()&lt;br /&gt;
hello(obj)&lt;br /&gt;
&lt;br /&gt;
# With reflection&lt;br /&gt;
class_name &amp;lt;- &amp;quot;foo&amp;quot;&lt;br /&gt;
generic_having_foo_method &amp;lt;- &amp;quot;hello&amp;quot;&lt;br /&gt;
obj &amp;lt;- do.call(class_name, list())&lt;br /&gt;
do.call(generic_having_foo_method, alist(obj))&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Ruby===&lt;br /&gt;
The following is an example in [[Ruby (programming language)|Ruby]]:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;ruby&amp;quot;&amp;gt;&lt;br /&gt;
# Without reflection&lt;br /&gt;
obj = Foo.new&lt;br /&gt;
obj.hello&lt;br /&gt;
&lt;br /&gt;
# With reflection&lt;br /&gt;
obj = Object.const_get(&amp;quot;Foo&amp;quot;).new&lt;br /&gt;
obj.send :hello&lt;br /&gt;
&lt;br /&gt;
# With eval&lt;br /&gt;
eval &amp;quot;Foo.new.hello&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
[[Rust (programming language)|Rust]] does not have compile-time reflection in the standard library, but it is possible using some third-party libraries such as &amp;quot;{{mono|bevy_reflect}}&amp;quot;.&amp;lt;ref&amp;gt;{{Cite web|title=bevy_reflect - Rust|url=https://docs.rs/bevy_reflect/latest/bevy_reflect/|website=docs.rs|date=30 May 2025}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rust&amp;quot;&amp;gt;&lt;br /&gt;
use std::any::TypeId;&lt;br /&gt;
&lt;br /&gt;
use bevy_reflect::prelude::*;&lt;br /&gt;
use bevy_reflect::{&lt;br /&gt;
    FunctionRegistry,&lt;br /&gt;
    GetTypeRegistration,&lt;br /&gt;
    Reflect, &lt;br /&gt;
    ReflectFunction,&lt;br /&gt;
    ReflectFunctionRegistry,&lt;br /&gt;
    ReflectMut, &lt;br /&gt;
    ReflectRef, &lt;br /&gt;
    TypeRegistry&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
#[derive(Reflect)]&lt;br /&gt;
#[reflect(DoFoo)]&lt;br /&gt;
struct Foo {&lt;br /&gt;
    // ...&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
impl Foo {&lt;br /&gt;
    fn new() -&amp;gt; Self {&lt;br /&gt;
        Foo {}&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    fn print_hello(&amp;amp;self) {&lt;br /&gt;
        println!(&amp;quot;Hello, world!&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#[reflect_trait]&lt;br /&gt;
trait DoFoo {&lt;br /&gt;
    fn print_hello(&amp;amp;self);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
impl DoFoo for Foo {&lt;br /&gt;
    fn print_hello(&amp;amp;self) {&lt;br /&gt;
        self.print_hello();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
fn main() {&lt;br /&gt;
    // Without reflection&lt;br /&gt;
    let foo: Foo = Foo::new();&lt;br /&gt;
    foo.print_hello();&lt;br /&gt;
&lt;br /&gt;
    // With reflection&lt;br /&gt;
    let mut registry: TypeRegistry = TypeRegistry::default();&lt;br /&gt;
&lt;br /&gt;
    registry.register::&amp;lt;Foo&amp;gt;();&lt;br /&gt;
    registry.register_type_data::&amp;lt;Foo, ReflectFunctionRegistry&amp;gt;();&lt;br /&gt;
    registry.register_type_data::&amp;lt;Foo, ReflectDoFoo&amp;gt;();&lt;br /&gt;
&lt;br /&gt;
    let foo: Foo = Foo;&lt;br /&gt;
    let reflect_foo: Box&amp;lt;dyn Reflect&amp;gt; = Box::new(foo);&lt;br /&gt;
&lt;br /&gt;
    // Version 1: call hello by trait&lt;br /&gt;
    let trait_registration: &amp;amp;ReflectDoFoo = registry&lt;br /&gt;
        .get_type_data::&amp;lt;ReflectDoFoo&amp;gt;(TypeId::of::&amp;lt;Foo&amp;gt;())&lt;br /&gt;
        .expect(&amp;quot;ReflectDoFoo not found for Foo&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
    let trait_object: &amp;amp;dyn DoFoo = trait_registration&lt;br /&gt;
        .get(&amp;amp;*reflect_foo)&lt;br /&gt;
        .expect(&amp;quot;Failed to get DoFoo trait object&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
    trait_object.print_hello();&lt;br /&gt;
&lt;br /&gt;
    // Version 2: call hello by function name&lt;br /&gt;
    let func_registry: &amp;amp;FunctionRegistry = registry&lt;br /&gt;
        .get_type_data::&amp;lt;FunctionRegistry&amp;gt;(TypeId::of::&amp;lt;Foo&amp;gt;())&lt;br /&gt;
        .expect(&amp;quot;FunctionRegistry not found for Foo&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
    if let Some(dyn_func) = func_registry.get(&amp;quot;print_hello&amp;quot;) {&lt;br /&gt;
        let result: Option&amp;lt;Box&amp;lt;dyn Reflect&amp;gt;&amp;gt; = dyn_func&lt;br /&gt;
            .call(&amp;amp;*reflect_foo, Vec::&amp;lt;Box&amp;lt;dyn Reflect&amp;gt;&amp;gt;::new())&lt;br /&gt;
            .ok();&lt;br /&gt;
&lt;br /&gt;
        if result.is_none() {&lt;br /&gt;
            println!(&amp;quot;Function called, no result returned (as expected for void return)&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
    } else {&lt;br /&gt;
        println!(&amp;quot;No function named hello found in FunctionRegistry&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Xojo===&lt;br /&gt;
The following is an example using [[Xojo]]:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;vbnet&amp;quot;&amp;gt;&lt;br /&gt;
&amp;#039; Without reflection&lt;br /&gt;
Dim fooInstance As New Foo&lt;br /&gt;
fooInstance.PrintHello&lt;br /&gt;
&lt;br /&gt;
&amp;#039; With reflection&lt;br /&gt;
Dim classInfo As Introspection.Typeinfo = GetTypeInfo(Foo)&lt;br /&gt;
Dim constructors() As Introspection.ConstructorInfo = classInfo.GetConstructors&lt;br /&gt;
Dim fooInstance As Foo = constructors(0).Invoke&lt;br /&gt;
Dim methods() As Introspection.MethodInfo = classInfo.GetMethods&lt;br /&gt;
For Each m As Introspection.MethodInfo In methods&lt;br /&gt;
  If m.Name = &amp;quot;PrintHello&amp;quot; Then&lt;br /&gt;
    m.Invoke(fooInstance)&lt;br /&gt;
  End If&lt;br /&gt;
Next&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
* [[List of reflective programming languages and platforms]]&lt;br /&gt;
* [[Mirror (programming)]]&lt;br /&gt;
* [[Programming paradigm]]s&lt;br /&gt;
* [[Self-hosting (compilers)]]&lt;br /&gt;
* [[Self-modifying code]]&lt;br /&gt;
* [[Type introspection]]&lt;br /&gt;
* [[typeof]]&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
=== Citations ===&lt;br /&gt;
{{Reflist}}&lt;br /&gt;
&lt;br /&gt;
=== Sources ===&lt;br /&gt;
{{refbegin}}&lt;br /&gt;
* Jonathan M. Sobel and Daniel P. Friedman. [https://web.archive.org/web/20100204091328/http://www.cs.indiana.edu/~jsobel/rop.html &amp;#039;&amp;#039;An Introduction to Reflection-Oriented Programming&amp;#039;&amp;#039;] (1996), [[Indiana University]].&lt;br /&gt;
* [https://www.codeproject.com/Articles/674455/Anti-Reflector-NET-Code-Protection Anti-Reflection technique using C# and C++/CLI wrapper to prevent code thief]&lt;br /&gt;
{{refend}}&lt;br /&gt;
&lt;br /&gt;
==Further reading==&lt;br /&gt;
* Ira R. Forman and Nate Forman, &amp;#039;&amp;#039;Java Reflection in Action&amp;#039;&amp;#039; (2005), {{ISBN|1-932394-18-4}}&lt;br /&gt;
* Ira R. Forman and Scott Danforth, &amp;#039;&amp;#039;Putting Metaclasses to Work&amp;#039;&amp;#039; (1999), {{ISBN|0-201-43305-2}}&lt;br /&gt;
&lt;br /&gt;
==External links==&lt;br /&gt;
* [https://www-master.ufr-info-p6.jussieu.fr/2007/Ajouts/Master_esj20_2007_2008/IMG/pdf/malenfant-ijcai95.pdf Reflection in logic, functional and object-oriented programming: a short comparative study]&lt;br /&gt;
* [https://web.archive.org/web/20100204091328/http://www.cs.indiana.edu/~jsobel/rop.html An Introduction to Reflection-Oriented Programming]&lt;br /&gt;
* [http://www.laputan.org/#Reflection Brian Foote&amp;#039;s pages on Reflection in Smalltalk]&lt;br /&gt;
* [http://docs.oracle.com/javase/tutorial/reflect/index.html Java Reflection API Tutorial] from Oracle&lt;br /&gt;
{{Programming paradigms navbox}}&lt;br /&gt;
{{Types of programming languages}}&lt;br /&gt;
&lt;br /&gt;
{{DEFAULTSORT:Reflection (Computer Programming)}}&lt;br /&gt;
[[Category:Programming constructs]]&lt;br /&gt;
[[Category:Programming language comparisons]]&lt;br /&gt;
&amp;lt;!-- Hidden categories below --&amp;gt;&lt;br /&gt;
[[Category:Articles with example BASIC code]]&lt;br /&gt;
[[Category:Articles with example C code]]&lt;br /&gt;
[[Category:Articles with example C Sharp code]]&lt;br /&gt;
[[Category:Articles with example Java code]]&lt;br /&gt;
[[Category:Articles with example JavaScript code]]&lt;br /&gt;
[[Category:Articles with example Julia code]]&lt;br /&gt;
[[Category:Articles with example Lisp (programming language) code]]&lt;br /&gt;
[[Category:Articles with example Objective-C code]]&lt;br /&gt;
[[Category:Articles with example Pascal code]]&lt;br /&gt;
[[Category:Articles with example Perl code]]&lt;br /&gt;
[[Category:Articles with example PHP code]]&lt;br /&gt;
[[Category:Articles with example Python (programming language) code]]&lt;br /&gt;
[[Category:Articles with example R code]]&lt;br /&gt;
[[Category:Articles with example Ruby code]]&lt;/div&gt;</summary>
		<author><name>~2025-34236-49</name></author>
	</entry>
</feed>