Choice context / accessing `this` and `self`outside a template defn
- LucianoOP 1
Say I have several templates which reuse code:
template Factorable with party : Party where signatory Party choice CanBeFactored : * controller party do f this self f : Template t => t -> ContractId t -> *The code
fcan be factored out. But it depends on the context of the choice - i.e. I want to have access toselfandthis(and I’ve probably missed something else there).Do i always have to write a function taking these two arguments, or is there some typeclass or other clever mechanism for accessing the context of the choice?
- cocreature 1
Writing a function is your only option here.