Reflection/List properties: Difference between revisions
Content added Content deleted
m (→{{header|Wren}}: Changed to Wren S/H) |
(Add Ecstasy example) |
||
Line 96: | Line 96: | ||
Properties of C: |
Properties of C: |
||
b</pre> |
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}}== |
=={{header|Elena}}== |