Standard Library

v0.1.0-beta.1

Reflection

The Reflection class offers runtime 'reflection'. What this means is you can inspect the types of objects at runtime using this class. Additionally you can also identify the fields of those types.

That said, runtime reflection is very slow and is not recommended. Usage can significantly slow down the VSL instance. This is because Reflection interferes with the native low-overhead of VSL and requires all interaction to go through a slow runtime-implemented polymorphism algorithms.

The reflect offers runtime reflection by taking advantage of VSL polymorphic RTTI. Please note that Reflection has a very high runtime cost and should pretty much only be used for debugging.

Initializers

  • public init(of: Object)

    Creates a Reflection instance for the passed object by analyzing its RTTI. This will store an instance of Object for as long as this class lives so really it is very bad idea to also pass Reflection structures around.

Methods