File: library.cpp

package info (click to toggle)
qlogo 0.92%2Bgit.1.29a5ca2-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,556 kB
  • sloc: cpp: 15,101; python: 5,098; sh: 30; makefile: 4
file content (610 lines) | stat: -rw-r--r-- 21,148 bytes parent folder | download | duplicates (2)
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

//===-- qlogo/library.cpp - Library text implementation -------*- C++ -*-===//
//
// This file is part of QLogo.
//
// QLogo is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 2 of the License, or
// (at your option) any later version.
//
// QLogo is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with QLogo.  If not, see <http://www.gnu.org/licenses/>.
//
//===----------------------------------------------------------------------===//
///
/// \file
/// This file contains the implementation of the QLogo library text, which
/// provides standard supporting functions to the QLogo language.
///
//===----------------------------------------------------------------------===//

#include "library.h"

QString libraryStr =
    "to ` :backq.list [:backq.depth 0]\n"
    "if emptyp :backq.list [op []]\n"
    "if equalp first :backq.list \"` ~\n"
    "   [op fput \"`\n"
    "            fput  (` first bf :backq.list :backq.depth+1)\n"
    "                  (` bf bf :backq.list :backq.depth)]\n"
    "if and wordp first :backq.list equalp first first :backq.list \", ~\n"
    "   [op backq.unquote (bf first :backq.list) (bf :backq.list) "
    ":backq.depth]\n"
    "if and wordp first :backq.list memberp first first :backq.list [\" :] ~\n"
    "   [op backq.word (first first :backq.list) (bf first :backq.list)\n"
    "                  (bf :backq.list) :backq.depth]\n"
    "if wordp first :backq.list ~\n"
    "   [op fput first :backq.list (` bf :backq.list :backq.depth)]\n"
    "op fput (` first :backq.list :backq.depth) (` bf :backq.list "
    ":backq.depth)\n"
    "end\n"
    "to backq.word :backq.symbol :backq.word :backq.rest :backq.depth\n"
    "if emptyp :backq.word ~\n"
    "   [output fput :backq.symbol (` :backq.rest :backq.depth)]\n"
    "if not equalp first :backq.word \", ~\n"
    "   [output fput (word :backq.symbol :backq.word)\n"
    "                (` :backq.rest :backq.depth)]\n"
    "localmake \"result backq.unquote (bf :backq.word) :backq.rest "
    ":backq.depth\n"
    "if wordp :result [output word :backq.symbol :result]\n"
    "output fput (word :backq.symbol first :result) bf :result\n"
    "end\n"
    "to backq.unquote :unquote.symbol :unquote.rest :unquote.depth\n"
    "localmake \"unquote.splicing \"false\n"
    "if not emptyp :unquote.symbol [\n"
    "   if equalp first :unquote.symbol \"@ [\n"
    "      make \"unquote.splicing \"true\n"
    "      make \"unquote.symbol butfirst :unquote.symbol\n"
    "]]\n"
    "if :unquote.depth=0 [\n"
    "  if emptyp :unquote.symbol\n"
    "     [output backq.combine run first :unquote.rest\n"
    "                           (` bf :unquote.rest :unquote.depth)]\n"
    "  output backq.combine run :unquote.symbol (` :unquote.rest "
    ":unquote.depth)\n"
    "]\n"
    "if emptyp :unquote.symbol ~\n"
    "   [output fput (ifelse :unquote.splicing [\",@] [\",])\n"
    "                fput (` first :unquote.rest :unquote.depth-1)\n"
    "                     (` bf :unquote.rest :unquote.depth)]\n"
    "if backq.all.commas :unquote.symbol ~\n"
    "   [output fput (ifelse :unquote.splicing [\",@] [\",])\n"
    "                fput (` (list :unquote.symbol first :unquote.rest)\n"
    "                        :unquote.depth-1)\n"
    "                     (` bf :unquote.rest :unquote.depth)]\n"
    "output fput (ifelse :unquote.splicing [\",@] [\",]) ~\n"
    "            fput (` (list :unquote.symbol) :unquote.depth-1) ~\n"
    "                 (` :unquote.rest :unquote.depth)\n"
    "end\n"
    "to backq.combine :this :those\n"
    "output ifelse :unquote.splicing [se :this :those] [fput :this :those]\n"
    "end\n"
    "to backq.all.commas :word\n"
    "if emptyp :word [output \"true]\n"
    "if equalp first :word \", ~\n"
    "   [if emptyp butfirst :word [output \"true]\n"
    "    if equalp first butfirst :word \"@ [output backq.all.commas bf bf "
    ":word]\n"
    "    output backq.all.commas butfirst :word]\n"
    "output \"false\n"
    "end\n"
    "\n"
    "to #\n"
    "if not namep \"template.number [op repcount]\n"
    "op :template.number\n"
    "end\n"
    "\n"
    "to backslashedp :char\n"
    "op vbarredp :char\n"
    "end\n"
    "\n"
    "to backslashed? :char\n"
    "op vbarredp :char\n"
    "end\n"
    "\n"
    "to buryall\n"
    "end\n"
    "\n"
    "to buryname :names\n"
    "end\n"
    "\n"
    "to cascade :cascade.limit [:cascade.inputs] 3\n"
    "if numberp :cascade.limit ~\n"
    "   [if lessp :cascade.limit 0 ~\n"
    "       [(throw \"error (se [cascade doesn't like] :cascade.limit [as "
    "input]))] ~\n"
    "    make \"cascade.limit `[greaterp :template.number ,[int "
    ":cascade.limit]]]\n"
    "local [cascade.templates template.vars cascade.final]\n"
    "make \"cascade.templates []\n"
    "make \"template.vars []\n"
    "make \"cascade.final [?1]\n"
    "cascade.setup :cascade.inputs\n"
    "op cascade1 1 :template.vars\n"
    "end\n"
    "to cascade.setup :inputs\n"
    "if emptyp :inputs [stop]\n"
    "if emptyp bf :inputs [make \"cascade.final first :inputs stop]\n"
    "make \"cascade.templates lput first :inputs :cascade.templates\n"
    "make \"template.vars lput first bf :inputs :template.vars\n"
    "cascade.setup bf bf :inputs\n"
    "end\n"
    "to cascade1 :template.number :template.vars\n"
    "if apply :cascade.limit :template.vars [op apply :cascade.final "
    ":template.vars]\n"
    "op cascade1 (:template.number+1) (cascade.eval :cascade.templates)\n"
    "end\n"
    "to cascade.eval :cascade.templates\n"
    "if emptyp :cascade.templates [op []]\n"
    "op fput (apply first :cascade.templates :template.vars) ~\n"
    "        (cascade.eval bf :cascade.templates)\n"
    "end\n"
    "\n"
    "to cascade.2 [:cascade2.inputs] 5\n"
    "op apply \"cascade :cascade2.inputs\n"
    "end\n"
    "\n"
    ".macro case :case.value :case.clauses [:caseignoredp \"true]\n"
    "catch \"case.error [output case.helper :case.value :case.clauses]\n"
    "(throw \"error [Empty CASE clause])\n"
    "end\n"
    "to case.helper :case.value :case.clauses\n"
    "if emptyp :case.clauses [output []]\n"
    "if emptyp first :case.clauses [throw \"case.error]\n"
    "if or equalp first first :case.clauses \"else ~\n"
    "      memberp :case.value first first :case.clauses ~\n"
    "   [output butfirst first :case.clauses]\n"
    "output case.helper :case.value butfirst :case.clauses\n"
    "end\n"
    "\n"
    ";to closeall\n"
    ";foreach allopen [close ?]\n"
    ";end\n"
    "\n"
    "to combine :this :those\n"
    "if wordp :those [output word :this :those]\n"
    "output fput :this :those\n"
    "end\n"
    "\n"
    ".macro cond :cond.clauses\n"
    "localmake \"cond.result cond.helper :cond.clauses\n"
    "if equalp first :cond.result \"error [(throw \"error last :cond.result)]\n"
    "output last :cond.result\n"
    "end\n"
    "to cond.helper :cond.clauses\n"
    "if emptyp :cond.clauses [output [[] []]]\n"
    "if emptyp first :cond.clauses [output [error [Empty COND clause]]]\n"
    "if equalp first first :cond.clauses \"else ~\n"
    "   [output list [] butfirst first :cond.clauses]\n"
    "ignore error\n"
    "catch \"error [localmake \"cond.result run first first :cond.clauses]\n"
    "localmake \"cond.error error\n"
    "if not emptyp :cond.error [output list \"error item 2 :cond.error]\n"
    "if not memberp :cond.result [true false] ~\n"
    "   [output list \"error fput :cond.result [not TRUE or FALSE]]\n"
    "if :cond.result [output list [] butfirst first :cond.clauses]\n"
    "output cond.helper butfirst :cond.clauses\n"
    "end\n"
    "\n"
    "to crossmap :cm.template [:cm.lists] 2\n"
    "if emptyp bf :cm.lists [op cm1 first :cm.lists 1 []]\n"
    "op cm1 :cm.lists 1 []\n"
    "end\n"
    "to cm1 :cm.lists :cm.level :template.vars\n"
    "if emptyp :cm.lists [op (list apply :cm.template :template.vars)]\n"
    "op cm2 first :cm.lists\n"
    "end\n"
    "to cm2 :cm.thislist\n"
    "if emptyp :cm.thislist [op []]\n"
    "local :cm.level\n"
    "make :cm.level first :cm.thislist\n"
    "op se (cm1 bf :cm.lists :cm.level+1 lput first :cm.thislist "
    ":template.vars) ~\n"
    "      (cm2 bf :cm.thislist)\n"
    "end\n"
    "\n"
    "to dequeue :the.queue.name\n"
    "local \"result\n"
    "make \"result first thing :the.queue.name\n"
    "make :the.queue.name butfirst thing :the.queue.name\n"
    "output :result\n"
    "end\n"
    "\n"
    ".macro do.until :until.instr :until.cond\n"
    "op se :until.instr (list \"until :until.cond :until.instr)\n"
    "end\n"
    "\n"
    ".macro do.while :while.instr :while.cond\n"
    "op se :while.instr (list \"while :while.cond :while.instr)\n"
    "end\n"
    "\n"
    "to edall\n"
    "edit contents\n"
    "end\n"
    "\n"
    "to edn :names\n"
    "edit namelist :names\n"
    "end\n"
    "\n"
    "to edns\n"
    "edit names\n"
    "end\n"
    "\n"
    "to edpl :names\n"
    "edit pllist :names\n"
    "end\n"
    "\n"
    "to edpls\n"
    "edit plists\n"
    "end\n"
    "\n"
    "to edps\n"
    "edit procedures\n"
    "end\n"
    "\n"
    "to ern :names\n"
    "erase namelist :names\n"
    "end\n"
    "\n"
    "to erpl :names\n"
    "erase pllist :names\n"
    "end\n"
    "\n"
    "to filep :filename\n"
    "ignore error\n"
    "catch \"error [openread :filename close :filename]\n"
    "output emptyp error\n"
    "end\n"
    "\n"
    "to file? :filename\n"
    "ignore error\n"
    "catch \"error [openread :filename close :filename]\n"
    "output emptyp error\n"
    "end\n"
    "\n"
    "to filter :filter.template :template.list [:template.number 1] ~\n"
    "          [:template.lists (list :template.list)]\n"
    "if emptyp :template.list [op :template.list]\n"
    "if apply :filter.template (list first :template.list) ~\n"
    "   [op combine (first :template.list) ~\n"
    "               (filter :filter.template bf :template.list "
    ":template.number+1)]\n"
    "op (filter :filter.template bf :template.list :template.number+1)\n"
    "end\n"
    "to ?rest [:which 1]\n"
    "output bf item :which :template.lists\n"
    "end\n"
    "\n"
    "to find :find.template :template.list [:template.number 1] ~\n"
    "        [:template.lists (list :template.list)]\n"
    "if emptyp :template.list [op []]\n"
    "if apply :find.template (list first :template.list) [op first "
    ":template.list]\n"
    "op (find :find.template bf :template.list :template.number+1)\n"
    "end\n"
    "to ?rest [:which 1]\n"
    "output bf item :which :template.lists\n"
    "end\n"
    "\n"
    ".macro for :for.values :for.instr ~\n"
    "   [:for.var first :for.values] ~\n"
    "   [:for.initial run first bf :for.values] ~\n"
    "   [:for.final run first bf bf :for.values] ~\n"
    "   [:for.step forstep] ~\n"
    "   [:for.tester (ifelse :for.step < 0 ~\n"
    "                        [[:for.initial < :for.final]] ~\n"
    "                        [[:for.initial > :for.final]])]\n"
    "local :for.var\n"
    "catch \"for.catchtag [op for.done runresult [forloop :for.initial]]\n"
    "op []\n"
    "end\n"
    "to forloop :for.initial\n"
    "make :for.var :for.initial\n"
    "if run :for.tester [throw \"for.catchtag]\n"
    "run :for.instr\n"
    ".maybeoutput forloop (:for.initial + :for.step)\n"
    "end\n"
    "to for.done :for.result\n"
    "if emptyp :for.result [op [stop]]\n"
    "op (list \"output \"first (list first :for.result))\n"
    "end\n"
    "to forstep\n"
    "if equalp count :for.values 4 [op run last :for.values]\n"
    "op ifelse :for.initial > :for.final [-1] [1]\n"
    "end\n"
    "\n"
    ".macro foreach [:foreach.inputs] 2\n"
    "catch \"foreach.catchtag ~\n"
    "      [op foreach.done runresult ~\n"
    "	    [foreach1 bl :foreach.inputs last :foreach.inputs 1]]\n"
    "op []\n"
    "end\n"
    "to foreach1 :template.lists :foreach.template :template.number\n"
    "if emptyp first :template.lists [throw \"foreach.catchtag]\n"
    "apply :foreach.template firsts :template.lists\n"
    ".maybeoutput foreach1 bfs :template.lists :foreach.template "
    ":template.number+1\n"
    "end\n"
    "to foreach.done :foreach.result\n"
    "if emptyp :foreach.result [op [stop]]\n"
    "op (list \"output \"first (list first :foreach.result))\n"
    "end\n"
    "to ?rest [:which 1]\n"
    "output bf item :which :template.lists\n"
    "end\n"
    "\n"
    "to gensym\n"
    "if not namep \"gensym.number [make \"gensym.number 0]\n"
    "make \"gensym.number :gensym.number + 1\n"
    "output word \"g :gensym.number\n"
    "end\n"
    "\n"
    "to ignore :stuff\n"
    "end\n"
    "\n"
    "to invoke :invoked.function [:invoke.inputs] 2\n"
    ".maybeoutput apply :invoked.function :invoke.inputs\n"
    "end\n"
    "\n"
    "to iseq :a :b\n"
    "if not (:a > :b) [output iseq1 :a :b]\n"
    "output map [[x] -1 * :x] iseq1 (-1 * :a) (-1 * :b)\n"
    "end\n"
    "to iseq1 :a :b\n"
    "if :a > :b [output []]\n"
    "output fput :a iseq1 :a + 1 :b\n"
    "end\n"
    "\n"
    ".macro localmake :name :value\n"
    "output (list \"local (word \"\" :name) \"apply \"\"make (list :name "
    ":value))\n"
    "end\n"
    "\n"
    "to macroexpand :expr\n"
    "local [name inputlist macro.result]\n"
    "make \"name first :expr\n"
    "make \"inputlist bf :expr\n"
    "if not macrop :name [(throw \"error (se :name [is not a macro.]))]\n"
    "define \"%%%$%macro.procedure text :name\n"
    "make \"macro.result run fput \"%%%$%macro.procedure :inputlist\n"
    "erase \"%%%$%macro.procedure\n"
    "op :macro.result\n"
    "end\n"
    "\n"
    "to map :map.template [:template.lists] 2\n"
    "op map1 :template.lists 1\n"
    "end\n"
    "to map1 :template.lists :template.number\n"
    "if emptyp first :template.lists [output first :template.lists]\n"
    "output combine (apply :map.template firsts :template.lists) ~\n"
    "               (map1 bfs :template.lists :template.number+1)\n"
    "end\n"
    "to ?rest [:which 1]\n"
    "output bf item :which :template.lists\n"
    "end\n"
    "\n"
    "to map.se :map.se.template [:template.lists] 2\n"
    "op map.se1 :template.lists 1\n"
    "end\n"
    "to map.se1 :template.lists :template.number\n"
    "if emptyp first :template.lists [output []]\n"
    "output sentence (apply :map.se.template firsts :template.lists) ~\n"
    "                (map.se1 bfs :template.lists :template.number+1)\n"
    "end\n"
    "to ?rest [:which 1]\n"
    "output bf item :which :template.lists\n"
    "end\n"
    "\n"
    "to mdarray :sizes [:origin 1]\n"
    "local \"array\n"
    "make \"array (array first :sizes :origin)\n"
    "if not emptyp bf :sizes ~\n"
    "   [for [i :origin [:origin + (first :sizes) - 1]] ~\n"
    "        [setitem :i :array (mdarray bf :sizes :origin)]]\n"
    "output :array\n"
    "end\n"
    "\n"
    "to mditem :index :array\n"
    "if emptyp :index [op :array]\n"
    "op mditem bf :index item first :index :array\n"
    "end\n"
    "\n"
    "to mdsetitem :index :array :val\n"
    "setitem last :index (mditem bl :index :array) :val\n"
    "end\n"
    "\n"
    "to name :name.value.input :name.variable.input\n"
    "make :name.variable.input :name.value.input\n"
    "end\n"
    "\n"
    "to namelist :names\n"
    "if wordp :names [output list [] (list :names)]\n"
    "output list [] :names\n"
    "end\n"
    "\n"
    "to pen\n"
    "op (list (ifelse pendownp [\"pendown] [\"penup]) ~\n"
    "         penmode pensize pencolor penpattern)\n"
    "end\n"
    "\n"
    "to pick :list\n"
    "output item (1+random count :list) :list\n"
    "end\n"
    "\n"
    "to pllist :names\n"
    "if wordp :names [output (list [] [] (list :names))]\n"
    "output (list [] [] :names)\n"
    "end\n"
    "\n"
    "to poall\n"
    "po contents\n"
    "end\n"
    "\n"
    "to pon :names\n"
    "ignore error\n"
    "catch \"error [po namelist :names]\n"
    "local \"err\n"
    "make \"err error\n"
    "if not emptyp :err [(throw \"error first bf :err)]\n"
    "end\n"
    "\n"
    "to pons\n"
    "po names\n"
    "end\n"
    "\n"
    "to pop :the.stack.name\n"
    "local \"result\n"
    "make \"result first thing :the.stack.name\n"
    "make :the.stack.name butfirst thing :the.stack.name\n"
    "output :result\n"
    "end\n"
    "\n"
    "to popl :names\n"
    "ignore error\n"
    "catch \"error [po pllist :names]\n"
    "local \"err\n"
    "make \"err error\n"
    "if not emptyp :err [(throw \"error first bf :err)]\n"
    "end\n"
    "\n"
    "to popls\n"
    "po plists\n"
    "end\n"
    "\n"
    "to pops\n"
    "po procedures\n"
    "end\n"
    "\n"
    "to pots\n"
    "pot procedures\n"
    "end\n"
    "\n"
    "to push :the.stack.name :the.item.value\n"
    "make :the.stack.name fput :the.item.value thing :the.stack.name\n"
    "end\n"
    "\n"
    "to ?rest [:which 1]\n"
    "output bf item :which :template.lists\n"
    "end\n"
    "\n"
    "to queue :the.queue.name :the.item.value\n"
    "make :the.queue.name lput :the.item.value thing :the.queue.name\n"
    "end\n"
    "\n"
    "to quoted :stuff\n"
    "if wordp :stuff [op word \"\" :stuff]\n"
    "op :stuff\n"
    "end\n"
    "\n"
    "to reduce :reduce.function :reduce.list\n"
    "if emptyp bf :reduce.list [op first :reduce.list]\n"
    "op apply :reduce.function (list (first :reduce.list) ~\n"
    "                                (reduce :reduce.function bf "
    ":reduce.list))\n"
    "end\n"
    "\n"
    "to remdup :list\n"
    "output filter [not memberp ? ?rest] :list\n"
    "end\n"
    "\n"
    "to remove :thing :list\n"
    "output filter [not equalp ? :thing] :list\n"
    "end\n"
    "\n"
    "to reverse :in [:out ifelse listp :in [[]] [\"]]\n"
    "if emptyp :in [output :out]\n"
    "output (reverse bf :in combine first :in :out)\n"
    "end\n"
    "\n"
    "to rseq :a :b :n\n"
    "output map [[x] :a + :x * (:b - :a) / (:n - 1)] iseq 0 :n - 1\n"
    "end\n"
    "\n"
    "to savel :cont :file [:oldwr writer]\n"
    "openwrite :file\n"
    "setwrite :file\n"
    "po :cont\n"
    "setwrite :oldwr\n"
    "close :file\n"
    "end\n"
    "\n"
    "to setpen :pen_data\n"
    "ifelse equalp first bf :pen_data \"reverse ~\n"
    "       [penreverse] ~\n"
    "       [ifelse equalp first bf :pen_data \"erase ~\n"
    "               [penerase] ~\n"
    "               [penpaint]]\n"
    "ifelse equalp first :pen_data \"penup [penup] [pendown]\n"
    "setpensize first bf bf :pen_data\n"
    "setpencolor first bf bf bf :pen_data\n"
    "setpenpattern first bf bf bf bf :pen_data\n"
    "end\n"
    "\n"
    "to transfer :transfer.limit :transfer.template :transfer.init\n"
    "output cascade.2 (ifelse emptyp :transfer.limit ~\n"
    "                         [[emptyp ?2]] ~\n"
    "                         [list \"transfer.end.test :transfer.limit]) ~\n"
    "                 :transfer.template [] [butfirst ?2] :transfer.init\n"
    "end\n"
    "\n"
    "to transfer.end.test :the.condition.expression\n"
    "if emptyp ?2 [output \"true]\n"
    "output run :the.condition.expression\n"
    "end\n"
    "to ?in\n"
    "output first ?2\n"
    "end\n"
    "to ?out\n"
    "output ?1\n"
    "end\n"
    "\n"
    "to unburyall\n"
    "unbury buried\n"
    "end\n"
    "to unburyname :names\n"
    "unbury namelist :names\n"
    "end\n"
    "\n"
    ".macro until :until.cond :until.instr\n"
    "if run :until.cond [op []]\n"
    "op se :until.instr (list \"until :until.cond :until.instr)\n"
    "end\n"
    "\n"
    ".macro while :while.cond :while.instr\n"
    "if not run :while.cond [op []]\n"
    "op se :while.instr (list \"while :while.cond :while.instr)\n"
    "end\n"
    "\n"
    "to xcor\n"
    "output first pos\n"
    "end\n"
    "\n"
    "to ycor\n"
    "output last pos\n"
    "end\n"
    "\n"
    "make \"caseignoredp \"true\n"
    "bury [[][caseignoredp][]]\n"
    "\n"
    "bury [` backq.word backq.unquote backq.combine backq.all.commas # "
    "backslashedp backslashed? contents buryall namelist\n"
    "        :names buryname cascade cascade.setup cascade1 cascade.eval "
    "cascade.2 case case.helper closeall combine cond\n"
    "        cond.helper crossmap cm1 cm2 dequeue do.until do.while edall edn "
    "edns edpl edpls edps emacs.debug ern erpl\n"
    "        filep file? filter ?rest find ?rest for forstep forloop for.done "
    "foreach foreach1 foreach.done ?rest ignore\n"
    "        invoke iseq iseq1 localmake macroexpand map map1 ?rest map.se "
    "map.se1 ?rest mdarray mditem mdsetitem name\n"
    "        namelist pen pick pllist poall pon pons pop popl popls pops pots "
    "push ?rest queue quoted reduce remdup remove\n"
    "        reverse rseq savel setpen transfer transfer.end.test ?in ?out "
    "unburyname until while xcor ycor gensym unburyall\n"
    "        [wr_elisp_code pw_elisp_code file_elisp_code trace_or_step "
    "gensym.number] []]\n";