Ignore:
Timestamp:
Mar 10, 2024, 11:21:18 AM (3 months ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
master
Children:
9398177
Parents:
b64d0f4
Message:

more switch to tabs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • doc/theses/mike_brooks_MMath/programs/sharing-demo.cfa

    rb64d0f4 r5546f50b  
    3737        assert( s1 == "a+c" );
    3838        sout | xstr(S1s1) | "\t& " | s1 | "\t& " | s1a | "\t& " | s2 | "\t\\\\";
    39      
     39
    4040        #define S1As1 s1a[1] = '-'
    4141        S1As1;
    4242        assert( s1a == "a-c" );
    4343        sout | xstr(S1As1) | "\t& " | s1 | "\t& " | s1a | "\t& " | s2 | "\t\\\\";
    44      
     44
    4545        #define S2s1 s2 [1] = '|'
    4646        S2s1;
     
    4949        sout | "\\end{tabular}";
    5050        sout | "\\par\\noindent";
    51      
     51
    5252        sout | "Assignment of a value is just a modificiation."
    5353                   "\nThe aliasing relationship is established at construction and is unaffected by assignment of a value.";
     
    6161        assert( s1 == "qrs" );
    6262        sout | xstr(S1qrs) | "\t& " | s1 | "\t& " | s1a | "\t& " | s2 | "\t\\\\";
    63    
     63
    6464        #define S1Atuv s1a = "tuv"
    6565        S1Atuv;
    6666        assert( s1a == "tuv" );
    6767        sout | xstr(S1Atuv) | "\t& " | s1 | "\t& " | s1a | "\t& " | s2 | "\t\\\\";
    68    
     68
    6969        #define S2wxy s2  = "wxy"
    7070        S2wxy;
     
    8787        assert( s2 == "wxy" );
    8888        sout | xstr(S1S2) | "\t& " | s1 | "\t& " | s1a | "\t& " | s2 | "\t\\\\";
    89    
     89
    9090        #define S1aaa s1  = "aaa"
    9191        S1aaa;
     
    9494        assert( s2 == "wxy" );
    9595        sout | xstr(S1aaa) | "\t& " | s1 | "\t& " | s1a | "\t& " | s2 | "\t\\\\";
    96    
     96
    9797        #define S2S1 s2  = s1
    9898        S2S1;
     
    101101        assert( s2 == "aaa" );
    102102        sout | xstr(S2S1) | "\t& " | s1 | "\t& " | s1a | "\t& " | s2 | "\t\\\\";
    103    
     103
    104104        #define S2bbb s2  = "bbb"
    105105        S2bbb;
     
    191191        sout | "\t\t\t\t& @s1@\t& @s1_mid@\t& @s2@\t\\\\";
    192192        sout | "\t& " | s1 | "\t& " | s1_mid | "\t& " | s2 | "\t\\\\";
    193    
     193
    194194        #define D2_s1mid_ff s1_mid = "ff"
    195195        D2_s1mid_ff;
     
    207207        sout | "\\end{tabular}";
    208208        sout | "\\par\\noindent";
    209    
     209
    210210    sout | "In the \\emph{ff} step, which is a positive example of flow across an aliasing relationship, the result is straightforward to accept because the flow direction is from contained (small) to containing (large).  The following rules for edits through aliasing substrings will guide how to flow in the opposite direction.";
    211211        sout | "\\par";
     
    233233        assert( s1_mid == "i" );
    234234        sout  | xstr(D2_s1mid_i)  | "\t& " | s1 | "\t& " | s1_mid | "\t\\\\";
    235    
     235
    236236        #define D2_s1mid_empty s1_mid = ""
    237237        D2_s1mid_empty;
     
    247247        sout | "\\end{tabular}";
    248248        sout | "\\par\\noindent";
    249    
     249
    250250    sout | "Multiple portions can be aliased.  When there are several aliasing substrings at once, the text editor analogy becomes an online multi-user editor.  I should be able to edit a paragraph in one place (changing the document's length), without my edits affecting which letters are within a mouse-selection that you had made previously, somewhere else.";
    251251        sout | "\\par\\noindent";
     
    279279        sout | "\\begin{tabular}{llllll}";
    280280        sout | "\t\t\t\t& @s1@\t& @s1_bgn@\t& @s1_crs@\t& @s1_mid@\t& @s1_end@\t\\\\";
    281    
     281
    282282        #define D2_s1crs_s1 string s1_crs = s1(3, 2)`shareEdits
    283283        D2_s1crs_s1;
     
    288288        assert( s1_end == "d" ); 
    289289        sout  | xstr(D2_s1crs_s1)  | "\t& " | s1 | "\t& " | s1_bgn | "\t& " | s1_crs | "\t& " | s1_mid | "\t& " | s1_end | "\t\\\\";
    290    
     290
    291291        #define D2_s1crs_ppp s1_crs = "+++"
    292292        D2_s1crs_ppp;
     
    316316
    317317        // "The extreme form of this shortening happens when a bystander alias is a proper substring of an edit.  The bystander becomes an empty substring."
    318    
     318
    319319        string all = "They said hello again";
    320320        string greet     = all(10,5)`shareEdits;
     
    327327        assert( greet_end == "o" );
    328328     
    329    
     329
    330330        greet = "sup";
    331331        assert( all == "They said sup again" );
     
    334334        // assert( greet_end == "" );
    335335     
    336    
     336
    337337 
    338338
     
    342342
    343343 
    344    
     344
    345345        greet_bgn = "what";
    346346     
     
    353353        // assert( greet_end == "" );    ------ Should be so, but fails
    354354     
    355    
     355
    356356        greet_end = "...";
    357357     
     
    365365        assert( greet_end == "..." );
    366366     
    367    
     367
    368368 
    369369
Note: See TracChangeset for help on using the changeset viewer.