Reflection/List properties: Difference between revisions

Add Ecstasy example
m (→‎{{header|Wren}}: Changed to Wren S/H)
(Add Ecstasy example)
 
Line 96:
Properties of C:
b</pre>
 
=={{header|Ecstasy}}==
For any object, the type of that object provides access to its properties:
 
<syntaxhighlight lang="ecstasy">
module test {
void run() {
@Inject Console console;
Property[] properties = &this.actualType.properties;
console.print($"The properties of {this}: {properties}");
}
}
</syntaxhighlight>
 
{{out}}
<pre>
x$ xec test
The properties of test: [immutable Array<Class<Object, Object, Object, Struct>> classes, immutable Map<String, Class<Object, Object, Object, Struct>> classByName, String simpleName, String qualifiedName, Version version, immutable Map<String, Module> modulesByPath]
</pre>
 
=={{header|Elena}}==
162

edits