The know flag doesn’t have anything to do with parent events.
e = (a: 1, parent: (b: 2));
e.know; // true
e[\b] // 2, ok
e.use { ~b } // 2, ok
e.b // 2, ok
e.know = false;
e[\b] // 2
e.use { ~b } // 2, ok
e.b // Message 'b' not understood.
Access to parent event keys using at, or, if the event is the currentEnvironment, using envirGet / ~envVar syntax, always works. There is no way to use know to stop that from working.
know is used only here, to forward to the error-generator if the flag is unset. So know affects only method calls that are not dispatched to true methods.
doesNotUnderstand { |selector... args, kwargs|
var sel, forward;
if (know.not) {
^this.superPerformArgs(\doesNotUnderstand, [selector] ++ args, kwargs)
};
Event usage in patterns has never relied on pseudo-method calls. Patterns put into events; event.play use-s the event so that ~envVar syntax works.
EventStreamPlayer accepts a “prototype” event, but this means only that the event is pre-populated with some values and functions. This usage of the word “prototype” is completely distinct from the concept of object prototyping.
(I don’t think anybody uses EventStreamPlayer’s event: arg, btw, because IMO it’s not well-modeled in the vanilla class library. A pattern’s behavior depends on the pattern and the prototype event and probably on the other resources as well, like buses or buffers. Currently, to use prototype events, you have to remember to pass in the protoevent every time you play the pattern, even though the pattern and the event are in practice tightly coupled. When tightly coupled entities are just free-floating without their relationship being modeled, problems will follow and discourage users from going there. This is why I made PR(\name) as a “process prototype,” analogous to a class, and BP(\name) as a “bound process,” analogous to an instance that’s bound to specific values. The BP unifies pattern, protoevent and resources under one roof. I have used protoevents – just this past week, in fact – because I have a proper architecture to support that usage: ( ... stuff ...) => ProtoEvent(\newThing) and then, in the PR, ~event = (eventKey: \newThing) and then I never have to think about it again, for that process.)
hjh