Reflection/List properties: Difference between revisions

Content added Content deleted
(Scala contribution added.)
Line 558: Line 558:
=={{header|Scala}}==
=={{header|Scala}}==
===Java Interoperability===
===Java Interoperability===
{{Out}}Best seen running in your browser [https://scastie.scala-lang.org/PYo43XQwT4atvLtzNfvY3g Scastie (remote JVM)].
{{Out}}Best seen running in your browser [https://scastie.scala-lang.org/MdkPxH6yTlS4W8TaXYxSgA Scastie (remote JVM)].
<lang Scala>object ListProperties extends App {
<lang Scala>object ListProperties extends App {
private val obj = new {
private val obj = new {
Line 572: Line 572:
clazz.getDeclaredFields.foreach(f => println(s"${f}}"))
clazz.getDeclaredFields.foreach(f => println(s"${f}}"))
}</lang>
}</lang>

=={{header|Tcl}}==
=={{header|Tcl}}==
Tcl objects do not have properties exactly (externally visible variables), though a common idiom pioneered by <b>Tk</b> is <i>options</i> exposed by the <tt>configure</tt> and <tt>cget</tt> commands.
Tcl objects do not have properties exactly (externally visible variables), though a common idiom pioneered by <b>Tk</b> is <i>options</i> exposed by the <tt>configure</tt> and <tt>cget</tt> commands.