My understanding of the proposal is that one problem to solve is that each layer must reference the final object before it's fully built
The way it's currently solved is to invoke a generator first to generate the layer (at a moment the methods references an unassigned variable, but that's ok, because methods aren't called yet)
Then, from the layers, build the final object and the "super layers" and feed them back via a second call to next with the proper arguments
A possible alternative would look like this on the consumer side :
I think this can work with self and suprs being initially blank objects ({}) that will be mutated later on during cake assembly
If further enforcement is necessary, an alternative is to make self and suprs proxies that throw if touched before being finalized and behave as expected when the objects have been finalized
My understanding of the proposal is that one problem to solve is that each layer must reference the final object before it's fully built The way it's currently solved is to invoke a generator first to generate the layer (at a moment the methods references an unassigned variable, but that's ok, because methods aren't called yet) Then, from the layers, build the final object and the "super layers" and feed them back via a second call to
next
with the proper argumentsA possible alternative would look like this on the consumer side :
I think this can work with
self
andsupr
s being initially blank objects ({}
) that will be mutated later on during cake assemblyIf further enforcement is necessary, an alternative is to make
self
andsupr
s proxies that throw if touched before being finalized and behave as expected when the objects have been finalizedattn @erights @katelynsills