back
[stylehouse.git] / G / Lafr / Adju
blob450f87fa83a301351ada08177c5a243a3185080f
1 # J Sunpit!
2 me.Adjuice = &acgts{
3     return me&Adjuiced,s .join(".~.")
5 me.Adjuiced = &acgts{
6     return split(s,"")
8 // Voice
9     // to Mind
10         
11     // operations
12         me.wind_A = &acgtscq{
13             isnu(s) and c = {ov:s}; s = {}
14             isnu(c) and c = {ov:c}
15             !isob(s) and s = peel(s)
16             !isob(c) and c = peel(c)
17             A = c.A || A
18             # what to do, ie $mind++
19             c.ov ||= me&A_default_ov
20             c.t ||= me&A_default_t
21             # < redoing sections:
22             c.ov < 0 and $rewind = 1; c.ov *= -1
23             rewind and c.incv = c.cv = c.ov
24             # < Xq|xq|x may index which t|cv input what
25             
26             # ...
27             me&winding_A,s,c,q
28             
29             $re = a&returns || (A&N||[])[0]
30             return re
31         }
32         me.A_default_ov = &acgt{
33             A&cv and return A&cv + 0.1
34             return 0.1
35         }
36         me.A_default_t = &acgt{
37             A&t and return A&t
38             return A.t
39         }
40         me.winding_A = &acgtscq{
41             q ||= {}
42             
43             # get the mind
44             $mind = me&seek_mind_A,c
45             # reaction branch
46             T = {up:T}
47             
48             while (1) {
49                 $t = mind.next()
50                 !t and break
51                 
52                 # < thinkseek
54                 # < bitseek
55                 # <=@o2 iterate themselves
56                 $M = ty&cv > 0.02 && !ts&self && Yc&M || [s];
57                 each in M {
58                     delete T.not;
59                     
60                 }
61                 delete T.not;
62                 T.hwack and mind.halt(); T.up.hwack = T.hwack; return
63             }
64             
65             # so Y looks @2, if last ty&cv < 2
66             A&cv = A&ov;
67         }
68         # iterate A&U A&cv->A&ov
69         me.seek_mind_A = &acgtc{
70             A&U = c.U || me&Yingmindo,A&t
71             # only resumable from a cv
72             # < cursor into U exactly and Go whither
73             #    and deal with it sometimes resolving differently
74             # is U[i++]
75             $i = 0
76             # going ov (and maybe cv)
77             c.ov and A&ov = c.ov
78             c.cv and A&cv = c.cv
79             A&ov and A&ov = sca(A&ov)
80             A&cv and A&cv = sca(A&cv)
81             $wascv = A&cv
82             # 
83             # random infloop stopper
84             $il = 30;
85             return {
86                 next: &{
87                     while (1) {
88                         il-- < 0 and throw "infloop"
89                         $t = A&U[i]
90                         # off the end
91                         !t and return
92                         i++
93                         # further than we go
94                         ty&cv > A&ov and return
95                         # from before, or c.incv allows redoing a cv
96                         ty&cv <= A&cv && c.incv != ty&cv and continue
97                         
98                         # is what to do
99                         c.incv and wascv = c.incv
100                         # usu so many at == cv all happen
101                         c.incv = ty&cv;
102                         
103                         return t
104                     }
105                 },
106                 # complete the next()
107                 # ! may set A&cv to one it is still doing.
108                 #  see # < cursor into U exactly
109                 done: &{
110                     A&cv = c.incv
111                 },
112                 # or dont
113                 halt: &{
114                     A&cv = wascv
115                 },
116             }
117         }
123 // Cat
124     // Inc
125     // Pro
126     // Run
127