Closed goldenstein64 closed 3 years ago
I massively reworked Behaviors
into Transform
, Reconcilers
and Replacers
and turned the usual behavior argument to GlobalBehaviors
and Copy:BehaveAs
into a shared namespace of high-level presets ("default"
/ "set"
) and sequences of more primitive copiers ({ "transform", "reconcile", "replace" }
) for even more versatility.
Behavior
, which can be set both globally and locally usingCopy.GlobalBehavior
andCopy:BehaveAs
respectively.Copy:BehaveAs
returns a "symbol", which is just a table that can be used anywhere in other tables. The distinction is made by registering said table inCopy.BehaviorMap
.default = transform > handler > literal
copy = handler > literal
, except it does not consider any values that are part of the new set.set = literal
pass = do nothing
Copy.GlobalBehavior
is used wheneverCopy()
comes across any literal that is not registered inCopy.BehaviorMap
.