Scala ではトレイトの相互再帰的合成ができるけれども、それを実際のプロジェクトで使わないのと同じような理由で、 cake pattern による DI も、(まともに機能すると信じて)実際のプロジェクトに使うことはない気がする
All inheritance is "trait composition" in Nix or Jsonnet. And there is a correct way to inherit lazy fields that preserves the sharing of computation nodes where bad ways fail badly, causing exponential duplication of state and other effects (ouch).
-
-
If a computation graph is acyclic, a computation node (or thunk) of the graph will be evaluated at most once and can be trivially shared. I think it is not a problem even in Scala (except for the initialization order problem, of course), right?
-
Once again, Scala doesn't implement inheritance of lazy fields. If you "simply" inherit a nullary function definition instead, you get exponential effect duplication and lack of proper state sharing as children inherit.
- 10 more replies
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
Read my blog!