From 7a29e260e9a63a200120a6ba224793c0daf486c0 Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Mon, 5 Sep 2016 04:04:02 +0200 Subject: [PATCH] tree-diff-language: remove the magic _THIS_ and _CHILD_ construct at first, this seemed like a good idea, but it caused already numerous quirks and headache all over the place. And now, with the intent to switch to the TreeMutator based implementation, it would be damn hard to retain these features, if at all possible. Thus let's ditch those in time and forget about it! --- .../diff/diff-tree-application-test.cpp | 6 +- wiki/renderengine.html | 5 +- wiki/thinkPad.ichthyo.mm | 71 ++++++++++++++++++- 3 files changed, 73 insertions(+), 9 deletions(-) diff --git a/tests/library/diff/diff-tree-application-test.cpp b/tests/library/diff/diff-tree-application-test.cpp index e0b574100..439bd2c39 100644 --- a/tests/library/diff/diff-tree-application-test.cpp +++ b/tests/library/diff/diff-tree-application-test.cpp @@ -134,8 +134,8 @@ namespace test{ , pick(CHILD_A) , skip(CHILD_T) , del(CHILD_T) - , pick(Ref::CHILD) // pick a child anonymously - , mut(Ref::THIS) // mutate the current element (the one just picked) + , after(Ref::END) // accept anything beyond as-is + , mut(SUB_NODE) , ins(ATTRIB3) , ins(ATTRIB_NODE) // attributes can also be nested objects , find(CHILD_A) @@ -153,7 +153,7 @@ namespace test{ , ins(CHILD_A) , ins(CHILD_A) , emu(ATTRIB_NODE) - , emu(Ref::THIS) + , emu(SUB_NODE) }); } diff --git a/wiki/renderengine.html b/wiki/renderengine.html index 638e54458..5783c9a94 100644 --- a/wiki/renderengine.html +++ b/wiki/renderengine.html @@ -8157,7 +8157,7 @@ As said, this turns out to be a tricky challenge: implementing the application o ** how to open a nested scope for recursive mutation -
+
for the purpose of handling updates in the GUI timeline display efficiently, we need to determine and represent //structural differences//
 This leads to what could be considered the very opposite of data-centric programming. Instead of embody »the truth« into a central data model with predefined layout, we base our achitecture on a set of actors and their collaboration. In the mentioned example this would be the high-level view in the Session, the Builder, the UI-Bus and the presentation elements within the timeline view. Underlying to each such collaboration is a shared conception of data. There is no need to //actually represent that data// -- it can be conceived to exist in a more descriptive, declarative [[external tree description (ETD)|ExternalTreeDescription]]. In fact, what we //do represent// is a ''diff'' against such an external rendering.
 
@@ -8217,8 +8217,7 @@ In addition, in a future extension, we might consider to introduce up/down foldi
 Since the bracketing construct for mutation of child structures bears the ID of the parent, a certain degree of leeway is introduced. In theory, we could always open such a bracketing construct right after the {{{pick}}} token accepting the parent -- yet, while minimal, such a strictly depth-first representation would be hard to read -- so we allow to group the recursive treatement of children //post-fix,// after the messages for the current node. In a similar vein, we introduce another token to describe a //short-cut://
 *{{{after}}}(node-ID) : fast-forward through the sequence of elements at current level until the position after the designated element.
 To complement this language construct, we define some special, magical (meta) element-~IDs
-*{{{_CHILD_}}} : marks an //unnamed// ID. Mostly, the implementation exploits this specific marker to distinguish between nodes which are (named) attributes of an object, and real children
-*{{{_THIS_}}} : can be used to refer to the immediately preceding element without knowing its name. Typically used to open a {{{mut(_THIS_)}}} ... {{{emu(_THIS_)}}} bracket to populate a newly inserted object
+*{{{_CHILD_}}} : marks an //unnamed// ID. The implementation exploits this specific marker to distinguish between nodes which are (named) attributes of an object, and real children.
 *{{{_ATTRIBS_}}} : can be used to jump {{{after(_ATTRIBS_)}}} when mutating the contents of an object. So the following diff verbs will immediately start working on the children
 *{{{_END_}}} : likewise can be used to jump {{{after(_END_)}}} to start appending new elements without caring for the existing current content.
 All these additional language constructs aren't strictly necessary, but widen the usability of the langauge, also to cover the description of incomplete or fuzzy diffs.
diff --git a/wiki/thinkPad.ichthyo.mm b/wiki/thinkPad.ichthyo.mm
index f8c38a1f3..aaffb39cf 100644
--- a/wiki/thinkPad.ichthyo.mm
+++ b/wiki/thinkPad.ichthyo.mm
@@ -1883,7 +1883,7 @@
 
 
 
-
+
 
 
 
@@ -5380,8 +5380,16 @@
 
 
 
+
+
 
-
+
+
+
+
+
+
+
 
 
   
@@ -5395,11 +5403,68 @@
 
 
 
+
+
+  
+    
+  
+  
+    

+ ...denn wir haben nun mehrere Layer, +

+

+ und der Selector kann einfach anhand von Ref::THIS keine sinnvolle Entscheidung treffen. +

+

+ Daher versuchen dann alle Layer dieses Element zu behandeln, oder gar keiner +

+

+ +

+

+ Und da der Selector nur die Spec anschauen darf, läßt sich das auch nachher nicht mehr korrigieren +

+

+ +

+

+ Daher habe ich mich entschlossen, dieses Sprachkonstrukt zu entfernen +

+ + +
- + + + + + + +

+ entfernt, da schlechtes Design +

+ +
+
+
+ + + + + + + + +

+ entfernt, da schlechtes Design +

+ + +
+