Posts tagged DesignStudy
Castle supports Generics (a bit like Templates in C++) but with a twist. For example, in (the improved version of)
“The Sieve demo (start/DRAFT)” we use the
SlowStart (base)protocol as a Generic protocol.
It becomes generic as we pass an
Argument to the base-class. Only that makes
SlowStart a generic!
It is not visual in the definition.
As this differs from other languages, it gives some questions. We will explain how to use it. And make some (high-level) hints on the implementation.
The RPy compiler backend needs to ‘fill-in’ some data structures, like
CC_B_Protocol – there is one for every
protocol. It contains the name of the protocol, its kind (like Event, as we assume here), and a list of
events. That event list contains the (event) name, it’s sequence-number (see: Modelling the Event Index), and a backlink
to the protocol.
The question is: Should the
Event (dataclass) contain the typedParameters?
This question affects both the runtime (for this backend) –the RPython implementation of
CC.buildin.CC_B_P_EventID– and the (jinja templating) to generate the code to fill those