Reflectable Capabilities

The Design of Reflectable Capabilities. github Erik Ernst

> We have described the design of the capabilities used in the package reflectable to specify the desired level of support for Reflection. The underlying idea is that the capabilities at the base level specify a selection of operations from the API of the mirror classes, along with some simple restrictions on the allowable arguments to those operations. On top of that, the API based capabilities can be associated with specific parts of the target program (though at this point only classes) such that exactly those classes will have the reflection support specified with the API based capabilities. The target classes can be selected individually, by adding a reflector as metadata on each target class. Alternatively, target classes can be selected by quantification: For instance, it is possible to quantify over all subtypes, in which case not only the class C that holds the metadata receives reflection support, but also all subtypes of C. Finally, it is possible to admit instances of subtypes as reflectees of a small set of mirrors, such that partial reflection support is achieved for many classes, without the cost of having many mirror classes.

References:

1. Gilad Bracha and David Ungar. "Mirrors: design principles for meta-level facilities of object-oriented programming languages". ACM SIGPLAN Notices. 24 Oct. 2004: 331-344. 1. Brian Cantwell Smith. "Procedural reflection in programming languages." 1982. 1. Jonathan M. Sobel and Daniel P. Friedman. "An introduction to reflection-oriented programming." Proceedings of Reflection. Apr. 1996. pdf