diff --git a/src/lib/diff/tree-mutator.hpp b/src/lib/diff/tree-mutator.hpp index b7a5120bc..0fd5ab3f0 100644 --- a/src/lib/diff/tree-mutator.hpp +++ b/src/lib/diff/tree-mutator.hpp @@ -385,6 +385,9 @@ namespace diff{ template using Change = ChangeOperation; + template + using MutateAttrib = MutationOperation; + template using Collection = ChildCollectionMutator; @@ -419,6 +422,17 @@ namespace diff{ return Change (attributeID, setterClosure, move(*this)); } + ///////////////////////////////////////TODO documentation + template + Builder> + mutateAttrib (Symbol attributeID, CLO mutatorBuilderClosure) + { + idi::EntryID key{attributeID}; + return MutateAttrib (key, mutatorBuilderClosure, move(*this)); + } + + ///////////////////////////////////////TODO define variant taking a GenNode::ID + /** set up a binding to a structure of "child objects", * implemented through a typical STL container * @param collectionBindingSetup as created by invoking a nested DSL, diff --git a/tests/library/diff/tree-mutator-binding-test.cpp b/tests/library/diff/tree-mutator-binding-test.cpp index f94dc0abe..8a782a732 100644 --- a/tests/library/diff/tree-mutator-binding-test.cpp +++ b/tests/library/diff/tree-mutator-binding-test.cpp @@ -833,6 +833,19 @@ namespace test{ { LOG_SETTER ("gamma") gamma = val; + }) + .mutateAttrib("δ", [&](TreeMutator::MutatorBuffer buff) + { + // NOTE: we use "implementation inside knowledge" regarding the nested scope, + // which is here represented as TestMutationTarget + buff.create ( + TreeMutator::build() + .attachDummy (delta)); + + // NOTE: when this closure is invoked, we're about to open the sub scope, + // while mutation has not happened yet + cout << "openSub()...\n" + << join(delta.getLog(), "\n") < subMutatorBuffer; TreeMutator::MutatorBuffer placementHandle(subMutatorBuffer); @@ -889,7 +903,9 @@ namespace test{ CHECK (not isnil (delta)); // ...and "magically" these instructions happened to insert cout << "Sub|" << delta.showContent() < -
+
The TreeMutator is an intermediary to translate a generic structure pattern into heterogeneous local invocation sequences.
 within the [[diff framework|TreeDiffModel]], this is a crucial joint, since here the abstract, generic, ~DOM-like ExternalTreeDescription meeds opaque, local and undisclosed data structures.
 
@@ -8341,13 +8341,13 @@ attached to a clip, or the mixture of clips, effects and labels found within a [
 :any re-ordering, inserting and deleting of fields is ''prohibited'', while defaultable optional fields are tolerated
 :there is only one common »binding layer« for object fields (i.e. we don't offer a customisable selector)
 :binding is created ''alternatively'' through the following closures
-:* "key", lambda {{{change: void(T val)}}}
+:* ''change'': "key", setter lambda {{{void(T val)}}}
 :** binding for a regular setter to assign a new value
 :** the value type is picked up from the provided lambda
 :** possible value types are restricted to the selection of GenNode payload types
 :** any further type conversions are to be handled by the closure and thus the client code
-:* "key", lambda {{{mutateAttrib: void(TreeMutator::MutatorBuffer)}}}
-:** fabricate a recursive sub-TreeMutator to handle an "object valued" attribute
+:* ''mutateAttrib'': "key", mutator-builder lambda {{{void(TreeMutator::MutatorBuffer)}}}
+:** fabricate a recursive sub-TreeMutator to handle an //object valued// attribute
 :** implicit typing -- the fabricated sub-TreeMutator just needs to be able to deal with the bound attribute
 
 
diff --git a/wiki/thinkPad.ichthyo.mm b/wiki/thinkPad.ichthyo.mm
index bfe9777c2..ff4758d47 100644
--- a/wiki/thinkPad.ichthyo.mm
+++ b/wiki/thinkPad.ichthyo.mm
@@ -4173,6 +4173,26 @@
 
 
 
+
+
+  
+    
+  
+  
+    

+ ...die offensichtlichsten Dinge übersieht man nur zu leicht!!!!! +

+

+ Da es ein nested scope ist, ist es immer ein Objekt, +

+

+ also repräsentiert als Rec<GenNode> +

+ + +
+ +