(Of course, this sets up some ambiguity between a virtual member and a filter. Why not just do awesomePerson | yell | size
?)
Note that with anything other than “yell”, we return a NilValue
. Why? Because “yell” should be the only member that ever comes after an AwesomeValue
. We just don’t support anything else, so if someone tries to call anything else, they get nothing back.
For a much more practical example, consider this code for XmlValue
which allows you to push an XML document into the context, and search it via a series of virtual members that GetValue
uses internally.