This document discusses advanced reflection capabilities in Pharo. It describes how instance variables were previously just described as strings, but can now be modeled as objects using a layout and slot system. Classes have a layout object that describes the memory layout. Slots know how to read and write values. Different types of slots are discussed like typed slots. The document also talks about modeling method structure as abstract syntax trees of node objects, allowing sub-method reflection. Future work includes making ASTs ubiquitous and using meta-links to annotate ASTs to modify code behavior without changing the source.
21. Status
• Slots are in Pharo3, but hidden
!
• In Pharo4: un-hide and introduce some Special
Slots (e.g. Boolean, Property)
• e.g. for Morphic (user interface objects)
29. • Method are Objects, but…
!
• No high-level model for sub-method elements
• Message sends
• Assignments
• Variable access
!
• Structural reflection stops at the granularity of methods!
45. What did we see?
• Slots!
• Instance variables are just described with strings
• We can do better! Layout, Slots
• ASTs Everywhere!
• Methods are objects, but internal structure not
modelled
• We can do better! AST, Sub-Method Reflection, Meta-
Links