about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-03-17 08:42:38 -0700
committerKartik K. Agaram <vc@akkartik.com>2015-03-17 09:06:48 -0700
commitb1bbe92da37dd44df458ffa122e052612bb9eff3 (patch)
tree976cde85c97d4877eb8c1e5151a919406fdd1049
parentc062697c9ff3c8cb0938f56bed3df2af3d122bd6 (diff)
downloadmu-b1bbe92da37dd44df458ffa122e052612bb9eff3.tar.gz
945 - move 'transform' layer to before 'run'
-rw-r--r--cpp/012transform (renamed from cpp/023transform)12
-rw-r--r--cpp/013run (renamed from cpp/012run)1
-rw-r--r--cpp/014arithmetic (renamed from cpp/013arithmetic)0
-rw-r--r--cpp/015boolean (renamed from cpp/014boolean)0
-rw-r--r--cpp/016jump (renamed from cpp/015jump)0
-rw-r--r--cpp/017compare (renamed from cpp/016compare)0
-rw-r--r--cpp/018record (renamed from cpp/017record)0
-rw-r--r--cpp/019address (renamed from cpp/018address)0
-rw-r--r--cpp/020array (renamed from cpp/019array)0
-rw-r--r--cpp/021call (renamed from cpp/020call)0
-rw-r--r--cpp/022call_ingredient (renamed from cpp/021call_ingredient)0
-rw-r--r--cpp/023call_reply (renamed from cpp/022call_reply)0
-rwxr-xr-xcpp/relayout61
13 files changed, 64 insertions, 10 deletions
diff --git a/cpp/023transform b/cpp/012transform
index faada76e..bb130187 100644
--- a/cpp/023transform
+++ b/cpp/012transform
@@ -1,17 +1,9 @@
-//: Let's start making mu more ergonomic to use. We'll create a list of tools
-//: that each transform a recipe. Anybody can add to the list.
+//: Once a set of recipes is loaded, it can be filtered through an extensible
+//: list of 'transforms'.
 //:
 //: The hope is that this framework of transform tools will provide a
 //: deconstructed alternative to conventional compilers.
 
-:(replace{} "void run(string form)")
-void run(string form) {
-  vector<recipe_number> tmp = add_recipes(form);
-  recipes_added_by_test.insert(recipes_added_by_test.end(), tmp.begin(), tmp.end());
-  transform_all();
-  run(recipes_added_by_test.front());
-}
-
 :(before "End Recipe Fields")
 size_t transformed_until;
   recipe() :transformed_until(-1) {}
diff --git a/cpp/012run b/cpp/013run
index f4dd6390..cd0a08a6 100644
--- a/cpp/012run
+++ b/cpp/013run
@@ -98,6 +98,7 @@ vector<recipe_number> recipes_added_by_test;
 void run(string form) {
   vector<recipe_number> tmp = add_recipes(form);
   recipes_added_by_test.insert(recipes_added_by_test.end(), tmp.begin(), tmp.end());
+  transform_all();
   run(recipes_added_by_test.front());
 }
 
diff --git a/cpp/013arithmetic b/cpp/014arithmetic
index 846fdff3..846fdff3 100644
--- a/cpp/013arithmetic
+++ b/cpp/014arithmetic
diff --git a/cpp/014boolean b/cpp/015boolean
index e6dd12ba..e6dd12ba 100644
--- a/cpp/014boolean
+++ b/cpp/015boolean
diff --git a/cpp/015jump b/cpp/016jump
index 2ce18859..2ce18859 100644
--- a/cpp/015jump
+++ b/cpp/016jump
diff --git a/cpp/016compare b/cpp/017compare
index 57f70279..57f70279 100644
--- a/cpp/016compare
+++ b/cpp/017compare
diff --git a/cpp/017record b/cpp/018record
index f42531be..f42531be 100644
--- a/cpp/017record
+++ b/cpp/018record
diff --git a/cpp/018address b/cpp/019address
index cd4f180e..cd4f180e 100644
--- a/cpp/018address
+++ b/cpp/019address
diff --git a/cpp/019array b/cpp/020array
index 8a9af8c4..8a9af8c4 100644
--- a/cpp/019array
+++ b/cpp/020array
diff --git a/cpp/020call b/cpp/021call
index 2e0000c0..2e0000c0 100644
--- a/cpp/020call
+++ b/cpp/021call
diff --git a/cpp/021call_ingredient b/cpp/022call_ingredient
index 0401d5b9..0401d5b9 100644
--- a/cpp/021call_ingredient
+++ b/cpp/022call_ingredient
diff --git a/cpp/022call_reply b/cpp/023call_reply
index 17f2c463..17f2c463 100644
--- a/cpp/022call_reply
+++ b/cpp/023call_reply
diff --git a/cpp/relayout b/cpp/relayout
new file mode 100755
index 00000000..e0b38c4b
--- /dev/null
+++ b/cpp/relayout
@@ -0,0 +1,61 @@
+#!/usr/bin/env zsh
+# Helper to change the numerical prefixes across the repo, say if you want to
+# create room between 023 and 024, and so on.
+
+setopt extendedglob
+
+if [[ $# -eq 0 && `git diff HEAD |wc -l` -gt 0 ]]
+then
+  echo "Uncommitted changes"
+  exit
+fi
+
+if [[ $# -gt 0 ]] # dry run
+then
+  git() {
+    echo $*
+  }
+fi
+
+#
+
+index=0
+ls [0-9]* |grep -v "^002trace.tests$" |sort -n |perl -pwe 's/\..*//' |
+  while read file
+  do
+    echo $file >&2
+    while [[ $file != `printf "%03d" $index`* ]]
+    do
+      echo
+      index=$(($index+1))
+    done
+    echo $file
+    index=$(($index+1))
+  done > .layout
+
+vim -c "set nu" .layout
+
+#
+
+root() {
+  echo $1 |perl -pwe 's/^[0-9]*//' |perl -pwe 's/\..*//'
+}
+
+index=0
+cat .layout |
+  while read file
+  do
+    if [ ! -z $file ]
+    then
+      newfile=`printf "%03d" $index``root $file`
+      if [[ $newfile != $file ]]
+      then
+        git mv $file $newfile
+      fi
+    fi
+    index=$(($index+1))
+  done
+
+#
+
+rm .layout
-11 23:18:26 -0700 experiment: new edit namespace' href='/akkartik/view.love/commit/edit.lua?id=2e3a85d94be44bfb53554d0e7ba8a36f8e91c605'>2e3a85d ^
fceb240 ^
8bbc1ff ^
2e3a85d ^
8bbc1ff ^


2e3a85d ^
8bbc1ff ^

8bbc1ff ^

8bbc1ff ^
0f4aea6 ^
2e3a85d ^
e2c1bbe ^



14c08f9 ^
e2c1bbe ^


6e2137c ^
0a12e4c ^
e2c1bbe ^



7f43375 ^



e2c1bbe ^

14c08f9 ^









e2c1bbe ^




0a12e4c ^

c43d884 ^







6f74f95 ^


96c056b ^
81ecca8 ^
8057f3e ^
0f4aea6 ^
3850fba ^
007b965 ^

f029c71 ^

3b36093 ^
2e3a85d ^
81ecca8 ^

2e3a85d ^
81ecca8 ^
2fc5bb9 ^

64eed74 ^
2fc5bb9 ^
64eed74 ^
2fc5bb9 ^


4b3f359 ^
2fc5bb9 ^



d61b5df ^
9501f01 ^
2fc5bb9 ^






2e3a85d ^
f2299cb ^
2fc5bb9 ^
2e3a85d ^
f61d426 ^
1937379 ^
f61d426 ^
2e3a85d ^
007b965 ^
2e3a85d ^

81ecca8 ^
3874f32 ^
2e3a85d ^
96c056b ^
2e3a85d ^

81ecca8 ^
e990b1b ^
0e0f36f ^
48162b9 ^
81ecca8 ^
2e3a85d ^


b700021 ^

0e0f36f ^
2e3a85d ^


81ecca8 ^
2e3a85d ^
81ecca8 ^
48162b9 ^
18f44c9 ^

2e3a85d ^


e0448d7 ^
219ee11 ^
81ecca8 ^
8a58888 ^
9656e13 ^
c29be0f ^
aadc50f ^


2e3a85d ^
3114176 ^




cf0ba7c ^

3114176 ^



81ecca8 ^
2e3a85d ^
48b7de4 ^
2e3a85d ^







2b3e09c ^
637e28f ^
81ecca8 ^



2e3a85d ^
2859063 ^
2e3a85d ^
9656e13 ^
2e3a85d ^

1937379 ^

81ecca8 ^

5b91af1 ^
e0448d7 ^
9656e13 ^
2e3a85d ^


9656e13 ^
bd6f7d4 ^
9656e13 ^


9501f01 ^
2e3a85d ^

2b3e09c ^
81ecca8 ^
9656e13 ^
8a58888 ^
81ecca8 ^
2b3e09c ^
b700021 ^
2e3a85d ^
5b91af1 ^
2e3a85d ^


9656e13 ^
bd6f7d4 ^





81ecca8 ^
2e3a85d ^
48b7de4 ^
9656e13 ^
81ecca8 ^
2e3a85d ^
2859063 ^
2e3a85d ^
9656e13 ^
bd6f7d4 ^

2e3a85d ^


bd6f7d4 ^

9501f01 ^
bd6f7d4 ^
9656e13 ^
2e3a85d ^


bd6f7d4 ^













99faf61 ^


bafc45b ^
99faf61 ^


a6dcfc5 ^
f2299cb ^
bafc45b ^
99faf61 ^





2b3e09c ^
eae5c95 ^
81ecca8 ^

5aae527 ^
eae5c95 ^
5b91af1 ^
81ecca8 ^
2e3a85d ^

5b91af1 ^
2e3a85d ^
92eccae ^

2b3e09c ^
92eccae ^
2e3a85d ^
b700021 ^
2e3a85d ^

2b3e09c ^
81ecca8 ^

2e3a85d ^


83722db ^
3b36093 ^
2e3a85d ^
81ecca8 ^
224e8fe ^
2e3a85d ^
81ecca8 ^
81ecca8 ^


f7d4dee ^
2e3a85d ^
81ecca8 ^
81ecca8 ^
2e3a85d ^
81ecca8 ^


2e3a85d ^
81ecca8 ^
5aae527 ^
2e3a85d ^
5aae527 ^
2e3a85d ^


81ecca8 ^
528c64d ^



3c04310 ^
2e3a85d ^
a1da18c ^
f7d4dee ^
2e3a85d ^
81ebc6a ^



2e3a85d ^
a1da18c ^
f7d4dee ^
3c04310 ^
2e3a85d ^
5b91af1 ^
2e3a85d ^

81ecca8 ^



d61b5df ^
22ad537 ^



b700021 ^
2e3a85d ^

5b91af1 ^
2e3a85d ^

81ecca8 ^



22ad537 ^



b700021 ^
2e3a85d ^

44aa822 ^


2e3a85d ^
188bbc7 ^
2e3a85d ^
7e97a2a ^
2e3a85d ^

3b36093 ^
2e3a85d ^
7e97a2a ^
2e3a85d ^
b700021 ^
2e3a85d ^
2e3a85d ^

81ecca8 ^
5b91af1 ^
7e97a2a ^
2e3a85d ^


800a5c0 ^
2e3a85d ^
800a5c0 ^
2e3a85d ^

f029c71 ^
3b36093 ^
2e3a85d ^
b700021 ^
5b91af1 ^
2e3a85d ^

4ce716f ^
1ede1c3 ^
2e3a85d ^
5b91af1 ^
2b3e09c ^
5b91af1 ^
b700021 ^
2e3a85d ^

81ecca8 ^
2e3a85d ^



eae5c95 ^
2e3a85d ^
81ecca8 ^

2e3a85d ^
5b91af1 ^
81ecca8 ^
2e3a85d ^


5b91af1 ^
2e3a85d ^

0ae94b0 ^





2e3a85d ^

b700021 ^
2e3a85d ^
4ce716f ^
2b3e09c ^
2e3a85d ^


2b3e09c ^
2e3a85d ^
92ad998 ^
a1da18c ^

0f4aea6 ^
a1da18c ^
a1da18c ^

2884f87 ^

06c784b ^

2884f87 ^
06c784b ^
2884f87 ^





06c784b ^
0f4aea6 ^
bd2179d ^
2884f87 ^

92ad998 ^
2b3e09c ^
92ad998 ^
2b3e09c ^



92ad998 ^
8b30e06 ^
92ad998 ^


2b3e09c ^
1d1a829 ^


92ad998 ^
8b30e06 ^
92ad998 ^


cfdac28 ^

e0448d7 ^
9501f01 ^
cfdac28 ^
2b3e09c ^
92ad998 ^
8b30e06 ^
92ad998 ^


cfdac28 ^

e0448d7 ^
92ad998 ^
8b30e06 ^
92ad998 ^


cfdac28 ^

2b3e09c ^
92ad998 ^
8b30e06 ^
92ad998 ^

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617