.. default-domain:: chpl .. module:: Reflection :synopsis: Functions for finding out about fields, functions, and methods. Reflection ========== **Usage** .. code-block:: chapel use Reflection; or .. code-block:: chapel import Reflection; Functions for finding out about fields, functions, and methods. .. note :: There are several ways in which this module could be improved upon: * the methods here might be better as type methods, so you could use `R.numFields()` instead of `numFields(R)`. * :proc:`getField` does not yet return a mutable value. .. function:: proc numFields(type t) param: int Return the number of fields in a class or record as a param. The count of fields includes types and param fields. .. function:: proc getFieldName(type t, param i: int) param: string Get the name of the ith field in a class or record. Causes a compilation error if `i` is not in 0..