-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathLow-Level Linked Lists.i7x
2221 lines (1672 loc) · 122 KB
/
Low-Level Linked Lists.i7x
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
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
Version 2 of Low-Level Linked Lists (for Glulx only) by Brady Garvin begins here.
"Linked lists for situations where Inform's lists aren't an option."
Include Runtime Checks by Brady Garvin.
Include Low-Level Operations by Brady Garvin.
Include Object Pools by Brady Garvin.
Include Low-Level Text by Brady Garvin.
Use authorial modesty.
Book "Copyright and License"
[Copyright 2013 Brady J. Garvin]
[This extension is released under the Creative Commons Attribution 3.0 Unported License (CC BY 3.0) so that it can qualify as a public Inform extension. See the LICENSE file included in the release for further details.]
Book "Extension Information"
[@]
[Inform already has lists in the form of, well, lists. But for the Glulx Runtime Instrumentation Framework we need to worry about:
1. Reentrancy---if we inject a call into the middle of a block value management routine (which we will), the callee can't be sure that the block value record keeping is in a consistent state.
2. Speed---the interpreter-provided malloc is usually much faster than Inform's non-native, space-conscious equivalent.
and
3. Payload size---the contents of Inform lists are individual items, either stored literally or by pointer. But there are several situation in the framework where it makes more sense to let the elements be pairs or even triples.
So we use our own implementation. However, the adjective ``low-level'' is important: these lists are more awkward and less forgiving than the nicely encapsulated Inform lists. They are suitable for use in the instrumentation framework and instrumentation extensions because that's what they were designed for. They might be appropriate in some other obscure situations. But they are not fit for general use in a story.]
[For each of the kinds defined by Low-Level Linked Lists you will see a sentence like
A linked list is an invalid linked list.
This bewildering statement actually sets up linked lists as a qualitative value with default value the linked list at address one, which, as we say, is invalid. (We could have gone with a quantitative kind for default zero, but then we would open up the possibility for arithmetic on the pointers.) I wish it weren't necessary, but at least in this build Inform doesn't let us provide a default value any other way, and, moreover, we need a default value or else only I6 substitutions are allowed to decide on linked lists.]
[@]
[We use comparators to check equality of underlying keys (see below). Properly speaking a comparator is a (phrase (value of kind K, K) -> truth state), but because of Inform bug 473 we have to write (phrase (value of kind K, K) -> nothing) instead. The first argument is the key being searched for and the second is the key being checked (comparators need not be symmetric). The result is true for equality, false otherwise.]
Chapter "Use Options"
Use a linked list vertex preallocation of at least 65536 translates as (- Constant LLLL_VERTEX_PREALLOC = {N}; -).
Book "Runtime Checks"
Chapter "Environment Checks"
An environment check rule (this is the check for dynamic memory allocation to support linked lists rule):
always check that memory allocation is supported or else say "[low-level runtime failure in]Low-Level Linked Lists[with explanation]This story uses low-level linked lists, which in turn depend on dynamic memory allocation. But this interpreter doesn't allow dynamic memory allocation, meaning that the story cannot safely run.[terminating the story]".
Book "Transfer Registers" - unindexed
[We have some non-void phrases that need to (1) take l-values and (2) cause side-effects between the time that they compute their result and return it. (1) means that we use I6 inlining, in which (2) gets expressed with the comma operator, as in (computeResult(), sideEffects(), result). For this to work, however, we need a place to store the result between computeResult() and the final operand's evaluation. We call such a place a transfer register; one is defined below.]
Include (-
Global llll_transfer;
-) after "Definitions.i6t".
The low-level linked list transfer register is a number that varies.
The low-level linked list transfer register variable translates into I6 as "llll_transfer".
Book "Linked List Vertices"
Chapter "The Linked List Vertex Kind"
A linked list vertex is a kind of value. The plural of linked list vertex is linked list vertices.
A linked list vertex is an invalid linked list vertex. [See the note in the book "Extension Information."]
The specification of a linked list vertex is "Linked list vertices are the storage unit for low-level linked lists; each list entry occupies exactly one vertex. A linked list vertex knows its key and underlying key, its value, and the linked list vertex that follows it, and can be asked for these values. The contents---the keys and the value---can also be changed. There are two exceptions, however: A null linked list vertex signifies the end of the list, and therefore has neither contents nor successor; it is invalid to ask for them or try to change them. Likewise for an invalid linked list vertex, which exists only to indicate that a linked list vertex variable has not been initialized."
Section "Linked List Vertex Constants"
To decide what linked list vertex is a null linked list vertex: (- 0 -).
Section "Linked List Vertex Adjectives"
[Performance note: If warranted, this definition could be inlined.]
Definition: a linked list vertex is null if it is a null linked list vertex.
Chapter "The Linked List Vertex Structure" - unindexed
[Layout:
4 bytes for the key
4 bytes for the value
4 bytes for the underlying key
4 bytes for the link to the next entry]
[We call the two payloads ``key'' and ``value'' since that nomenclature works nicely with Low-Level Hash Tables. By convention, if only one payload is in use, it should be the ``key.'']
[The field called ``underlying key'' is for block-value cases: often we use the hash of the block-value as the key proper, but we need some way to recover what we think of as the key. So we store the hash as the ``key'' and the pointer as the ``underlying key.'']
[It might more organizational sense to put the key and underlying key together, but the key and value are better stored contiguously when we use @linkedsearch to look for a particular key/value pair.]
[Linked list vertices do not ordinarily manage the lifetime of their links, but we can delete everything reachable from a beginning vertex if we so choose.]
To decide what number is the size in memory of a linked list vertex: (- 16 -).
Section "Linked List Vertex Construction and Destruction" - unindexed
The linked list vertex object pool is an object pool that varies.
[Bind to the real implementation only after allocating the pool.]
Include (-
Global llll_new = llll_newResolve;
-) after "Definitions.i6t".
Include (-
[ llll_newByPool key value underlyingKey link
result;
result = op_poolAllocate((+ the linked list vertex object pool +));
@astore result 0 key;
@astore result 1 value;
@astore result 2 underlyingKey;
@astore result 3 link;
return result;
];
[ llll_newResolve key value underlyingKey link;
(+ the linked list vertex object pool +) = op_newPool(LLLL_VERTEX_PREALLOC, 16); ! depends on layout
llll_new = llll_newByPool;
return llll_newByPool(key, value, underlyingKey, link);
];
-).
To decide what linked list vertex is a new linked list vertex with the key (K - a value) and the underlying key (U - a value) and the value (V - a value) and the link (L - a linked list vertex): (- llll_new({K}, {V}, {U}, {L}) -).
To decide what linked list vertex is a new linked list vertex with the key (K - a value) and the link (L - a linked list vertex):
decide on a new linked list vertex with the key K and the underlying key zero and the value zero and the link L.
To decide what linked list vertex is a new linked list vertex with the key (K - a value) and the underlying key (U - a value) and the link (L - a linked list vertex):
decide on a new linked list vertex with the key K and the underlying key U and the value zero and the link L.
To decide what linked list vertex is a new linked list vertex with the textual key (K - some text) and the link (L - a linked list vertex) (this is creating a linked list vertex by textual key and link):
decide on a new linked list vertex with the key the normal hash of K and the underlying key K and the value zero and the link L.
To decide what linked list vertex is a new linked list vertex with the key (K - a value) and the value (V - a value) and the link (L - a linked list vertex):
decide on a new linked list vertex with the key K and the underlying key zero and the value V and the link L.
To decide what linked list vertex is a new linked list vertex with the textual key (K - some text) and the value (V - a value) and the link (L - a linked list vertex):
decide on a new linked list vertex with the key the normal hash of K and the underlying key K and the value V and the link L.
To delete (A - a linked list vertex) (this is deleting a linked list vertex):
free the memory allocation at address (A converted to a number) to the linked list vertex object pool.
To delete (A - a linked list vertex) and its successors (this is deleting a linked list vertex and its successors):
let the link be the link of A;
free the memory allocation at address (A converted to a number) to the linked list vertex object pool;
while the link is not null:
let the vertex be the link;
now the link is the link of the vertex;
free the memory allocation at address (vertex converted to a number) to the linked list vertex object pool.
Section "Private Linked List Vertex Accessors and Mutators" - unindexed
To write the link (L - a linked list vertex) to (A - a linked list vertex): (- llo_setField({A}, 3, {L}); -).
Section "Public Linked List Vertex Accessors and Mutators"
To decide what K is the (D - a description of values of kind K) key of (A - a linked list vertex): (- llo_getInt({A}) -).
To write the key (K - a value) to (A - a linked list vertex): (- llo_setInt({A}, {K}); -).
To decide what K is the (D - a description of values of kind K) value of (A - a linked list vertex): (- llo_getField({A}, 1) -).
To write the value (V - a value) to (A - a linked list vertex): (- llo_setField({A}, 1, {V}); -).
To decide what K is the underlying (D - a description of values of kind K) key of (A - a linked list vertex): (- llo_getField({A}, 2) -).
To write the underlying key (U - a value) to (A - a linked list vertex): (- llo_setField({A}, 2, {U}); -).
To decide what linked list vertex is the link of (A - a linked list vertex): (- llo_getField({A}, 3) -).
Book "Linked Lists"
[@]
[Many of the public phrases expect their linked list arguments to be l-values. Unfortunately, there's no good way to tell the I7 compiler that, so passing an r-value is likely to get us an I6 error.]
Chapter "The Linked List Kind"
A linked list is a kind of value.
A linked list is an invalid linked list. [See the note in the book "Extension Information."]
The specification of a linked list is "A flexible-length list, much like the list kind that is built into Inform. These linked lists differ in three notable ways: (1) They do not use Inform's block value management system, which means that they can be used safely even when that management system is in an intermediate or inconsistent state. This, in fact, is why they were introduced. But it also means that linked lists must be explicitly allocated and freed. (2) They store up to three pieces of content per entry: a key, an underlying key, and a value. See the extension documentation for the differences between these kinds of content. (3) They support a slightly different (and slightly more error-prone) interface. Again, consult the extension documentation for details."
Section "Linked List Constants"
To decide what linked list is an empty linked list: (- 0 -).
Section "Assignment"
[@]
To write (S - a linked list) to (D - a linked list): (- {D} = {S}; -).
Section "Deep Copying"
To decide what linked list is a new copy of (L - a linked list) (this is creating a linked list from a linked list):
let the result be an empty linked list;
let the result's tail be an empty linked list's tail;
repeat with the linked list vertex running through L:
enqueue the key the number key of the linked list vertex and the underlying key the underlying number key of the linked list vertex and the value the number value of the linked list vertex in the result through the result's tail;
decide on the result.
To decide what linked list is a new copy of (L - a permanent linked list) (this is creating a linked list from a permanent linked list):
let the result be an empty linked list;
let the result's tail be an empty linked list's tail;
repeat with the linked list vertex running through L:
enqueue the key the number key of the linked list vertex and the underlying key the underlying number key of the linked list vertex and the value the number value of the linked list vertex in the result through the result's tail;
decide on the result.
Section "Linked List Adjectives"
[Performance note: If warranted, these definitions could be inlined.]
Definition: a linked list is empty if it is zero converted to a linked list.
Definition: a linked list is unit if the link of it converted to a linked list vertex is null. [The seemingly missing extra condition, "it is not empty", can safely be omitted because the "link" of a null vertex will be a value from the Glulx header, and the header cannot contain a zero word until offset 32.]
Section "Linked List Length"
To decide what number is the length of (L - a linked list) (this is measuring a linked list):
let the result be zero;
repeat with a linked list vertex running through L:
increment the result;
decide on the result.
Section "Linked List Destruction"
To delete (A - a linked list) (this is deleting a linked list):
unless A is empty:
delete A converted to a linked list vertex and its successors.
Book "Linked List Tails"
[@]
[Many of the public phrases expect their linked list tail arguments to be l-values. Unfortunately, there's no good way to tell the I7 compiler that, so passing an r-value is likely to get us an I6 error.]
Chapter "The Linked List Tail Kind"
A linked list tail is a kind of value.
A linked list tail is an invalid linked list tail. [See the note in the book "Extension Information."]
The specification of a linked list tail is "A linked list tail is an opaque kind (meaning that we don't get to see what's inside) whose values are used to improve the efficiency of some linked list operations, notably enqueuing and dequeuing."
Section "Linked List Tail Constants" - unindexed
To decide what linked list tail is an empty linked list's tail: (- 0 -).
Section "Linked List Tail Extraction"
Include (-
[ llll_justBefore address link
result;
if (~~address || address == link) {
return 0;
}
@linkedsearch
link ! the ``key'' to search for
4 ! the size of the ``key'' in bytes
address ! the address of the first structure to search
12 ! the offset to the ``key''
12 ! the offset to the link
0 ! the options (no need for special options)
result;
return result;
];
-).
To decide what linked list tail is the tail of (A - a linked list): (- llll_justBefore({A}, 0) -).
Book "Permanent Linked List Vertices"
Chapter "The Permanent Linked List Vertex Kind"
A permanent linked list vertex is a kind of value. The plural of permanent linked list vertex is permanent linked list vertices.
A permanent linked list vertex is an invalid permanent linked list vertex. [See the note in the book "Extension Information."]
The specification of a permanent linked list vertex is "Permanent linked list vertices are the storage unit for low-level, permanent linked lists; each list entry occupies exactly one vertex. A permanent linked list vertex knows its key and underlying key, its value, and the linked list vertex that follows it, and can be asked for these values. The contents---the keys and the value---can also be changed. There are two exceptions, however: A null permanent linked list vertex signifies the end of the list, and therefore has neither contents nor successor; it is invalid to ask for them or try to change them. Likewise for an invalid permanent linked list vertex, which exists only to indicate that a permanent linked list vertex variable has not been initialized."
Section "Permanent Linked List Vertex Constants"
To decide what permanent linked list vertex is a null permanent linked list vertex: (- 0 -).
Section "Permanent Linked List Vertex Adjectives"
[Performance note: If warranted, this definition could be inlined.]
Definition: a permanent linked list vertex is null if it is a null permanent linked list vertex.
Chapter "The Permanent Linked List Vertex Structure"
Section "Permanent Linked List Vertex Construction" - unindexed
To decide what permanent linked list vertex is a new permanent linked list vertex with the key (K - a value) and the link (L - a permanent linked list vertex):
let the result be a permanent memory allocation of the size in memory of a linked list vertex bytes converted to a permanent linked list vertex;
write the key K to the result;
write the link L to the result;
decide on the result.
To decide what permanent linked list vertex is a new permanent linked list vertex with the key (K - a value) and the underlying key (U - a value) and the link (L - a permanent linked list vertex):
let the result be a permanent memory allocation of the size in memory of a linked list vertex bytes converted to a permanent linked list vertex;
write the key K to the result;
write the underlying key U to the result;
write the link L to the result;
decide on the result.
To decide what permanent linked list vertex is a new permanent linked list vertex with the textual key (K - some text) and the link (L - a permanent linked list vertex) (this is creating a permanent linked list vertex by textual key and link):
let the result be a permanent memory allocation of the size in memory of a linked list vertex bytes converted to a permanent linked list vertex;
write the key the normal hash of K to the result;
write the underlying key K to the result;
write the link L to the result;
decide on the result.
To decide what permanent linked list vertex is a new permanent linked list vertex with the key (K - a value) and the value (V - a value) and the link (L - a permanent linked list vertex):
let the result be a permanent memory allocation of the size in memory of a linked list vertex bytes converted to a permanent linked list vertex;
write the key K to the result;
write the value V to the result;
write the link L to the result;
decide on the result.
To decide what permanent linked list vertex is a new permanent linked list vertex with the key (K - a value) and the underlying key (U - a value) and the value (V - a value) and the link (L - a permanent linked list vertex):
let the result be a permanent memory allocation of the size in memory of a linked list vertex bytes converted to a permanent linked list vertex;
write the key K to the result;
write the underlying key U to the result;
write the value V to the result;
write the link L to the result;
decide on the result.
To decide what permanent linked list vertex is a new permanent linked list vertex with the textual key (K - some text) and the value (V - a value) and the link (L - a permanent linked list vertex):
let the result be a permanent memory allocation of the size in memory of a linked list vertex bytes converted to a permanent linked list vertex;
write the key the normal hash of K to the result;
write the underlying key K to the result;
write the value V to the result;
write the link L to the result;
decide on the result.
Section "Private Permanent Linked List Vertex Accessors and Mutators" - unindexed
To write the link (L - a permanent linked list vertex) to (A - a permanent linked list vertex): (- llo_setField({A}, 3, {L}); -).
Section "Public Permanent Linked List Vertex Accessors and Mutators"
To decide what K is the (D - a description of values of kind K) key of (A - a permanent linked list vertex): (- llo_getInt({A}) -).
To write the key (K - a value) to (A - a permanent linked list vertex): (- llo_setInt({A}, {K}); -).
To decide what K is the (D - a description of values of kind K) value of (A - a permanent linked list vertex): (- llo_getField({A}, 1) -).
To write the value (V - a value) to (A - a permanent linked list vertex): (- llo_setField({A}, 1, {V}); -).
To decide what K is the underlying (D - a description of values of kind K) key of (A - a permanent linked list vertex): (- llo_getField({A}, 2) -).
To write the underlying key (U - a value) to (A - a permanent linked list vertex): (- llo_setField({A}, 2, {U}); -).
To decide what permanent linked list vertex is the link of (A - a permanent linked list vertex): (- llo_getField({A}, 3) -).
Book "Permanent Linked Lists"
[@]
[Many of the public phrases expect their permanent linked list arguments to be l-values. Unfortunately, there's no good way to tell the I7 compiler that, so passing an r-value is likely to get us an I6 error.]
Chapter "The Permanent Linked List Kind"
A permanent linked list is a kind of value.
A permanent linked list is an invalid permanent linked list. [See the note in the book "Extension Information."]
The specification of a permanent linked list is "A flexible-length list, much like the list kind that is built into Inform. These linked lists differ in four notable ways: (1) They do not use Inform's block value management system, which means that they can be used safely even when that management system is in an intermediate or inconsistent state. This, in fact, is why they were introduced. But it also means that linked lists must be explicitly allocated. (2) They store up to three pieces of content per entry: a key, an underlying key, and a value. See the extension documentation for the differences between these kinds of content. (3) They support a slightly different (and slightly more error-prone) interface. Again, consult the extension documentation for details. (4) Entries are 'permanent'. We can add entries to such a list, but we can never remove them. We cannot delete the list either. See the kind 'linked list' for a version that does not have this restriction, though at the expense of performance under certain interpreters."
Section "Permanent Linked List Constants"
To decide what permanent linked list is an empty permanent linked list: (- 0 -).
Section "Assignment"
[@]
To write (S - a permanent linked list) to (D - a permanent linked list): (- {D} = {S}; -).
Section "Deep Copying"
To decide what permanent linked list is a new permanent copy of (L - a linked list) (this is creating a permanent linked list from a linked list):
let the result be an empty permanent linked list;
let the result's tail be an empty permanent linked list's tail;
repeat with the linked list vertex running through L:
enqueue the key the number key of the linked list vertex and the underlying key the underlying number key of the linked list vertex and the value the number value of the linked list vertex in the result through the result's tail;
decide on the result.
To decide what permanent linked list is a new permanent copy of (L - a permanent linked list) (this is creating a permanent linked list from a permanent linked list):
let the result be an empty permanent linked list;
let the result's tail be an empty permanent linked list's tail;
repeat with the linked list vertex running through L:
enqueue the key the number key of the linked list vertex and the underlying key the underlying number key of the linked list vertex and the value the number value of the linked list vertex in the result through the result's tail;
decide on the result.
Section "Permanent Linked List Adjectives"
[Performance note: If warranted, these definitions could be inlined.]
Definition: a permanent linked list is empty if it is zero converted to a permanent linked list.
Definition: a permanent linked list is unit if the link of it converted to a permanent linked list vertex is null.
Section "Permanent Linked List Length"
To decide what number is the length of (L - a permanent linked list) (this is measuring a permanent linked list):
let the result be zero;
repeat with a permanent linked list vertex running through L:
increment the result;
decide on the result.
Book "Permanent Linked List Tails"
[@]
[Many of the public phrases expect their permanent linked list tail arguments to be l-values. Unfortunately, there's no good way to tell the I7 compiler that, so passing an r-value is likely to get us an I6 error.]
Chapter "The Permanent Linked List Tail Kind"
A permanent linked list tail is a kind of value.
A permanent linked list tail is an invalid permanent linked list tail. [See the note in the book "Extension Information."]
The specification of a permanent linked list tail is "A permanent linked list tail is an opaque kind (meaning that we don't get to see what's inside) whose values are used to improve the efficiency of some permanent linked list operations, notably enqueuing and dequeuing."
Section "Permanent Linked List Tail Constants" - unindexed
To decide what permanent linked list tail is an empty permanent linked list's tail: (- 0 -).
Section "Permanent Linked List Tail Extraction"
To decide what permanent linked list tail is the tail of (A - a permanent linked list): (- llll_justBefore({A}, 0) -).
Book "Linked List Interfaces"
Chapter "Stack Interface"
Section "Linked List Transformations used by the Stack Interface" - unindexed
To decide what linked list is (A - a linked list) after pushing the key (K - a number) (this is pushing a key onto a linked list):
let the result be a new linked list vertex with the key K and the link A converted to a linked list vertex;
decide on the result converted to a linked list.
To decide what linked list is (A - a linked list) after pushing the key (K - a value):
let the result be a new linked list vertex with the key K and the link A converted to a linked list vertex;
decide on the result converted to a linked list.
To decide what linked list is (A - a linked list) after pushing the key (K - a number) and the underlying key (U - a number) (this is pushing a key and underlying key onto a linked list):
let the result be a new linked list vertex with the key K and the underlying key U and the link A converted to a linked list vertex;
decide on the result converted to a linked list.
To decide what linked list is (A - a linked list) after pushing the key (K - a value) and the underlying key (U - a value):
let the result be a new linked list vertex with the key K and the underlying key U and the link A converted to a linked list vertex;
decide on the result converted to a linked list.
To decide what linked list is (A - a linked list) after pushing the key (K - a number) and the value (V - a number) (this is pushing a key and value onto a linked list):
let the result be a new linked list vertex with the key K and the value V and the link A converted to a linked list vertex;
decide on the result converted to a linked list.
To decide what linked list is (A - a linked list) after pushing the key (K - a value) and the value (V - a value):
let the result be a new linked list vertex with the key K and the value V and the link A converted to a linked list vertex;
decide on the result converted to a linked list.
To decide what linked list is (A - a linked list) after pushing the key (K - a number) and the underlying key (U - a number) and the value (V - a number) (this is pushing a key and underlying key and value onto a linked list):
let the result be a new linked list vertex with the key K and the underlying key U and the value V and the link A converted to a linked list vertex;
decide on the result converted to a linked list.
To decide what linked list is (A - a linked list) after pushing the key (K - a value) and the underlying key (U - a value) and the value (V - a value):
let the result be a new linked list vertex with the key K and the underlying key U and the value V and the link A converted to a linked list vertex;
decide on the result converted to a linked list.
To decide what linked list is (A - a linked list) after popping a linked list vertex (this is popping a linked list vertex off of a linked list):
now the low-level linked list transfer register is A converted to a number;
if A is empty:
decide on an empty linked list;
let the result be the link of A converted to a linked list vertex;
decide on the result converted to a linked list.
To decide what linked list is (A - a linked list) after popping a key (this is popping a key off of a linked list):
let the beginning linked list vertex be A converted to a linked list vertex;
if the beginning linked list vertex is null:
now the low-level linked list transfer register is zero;
decide on an empty linked list;
now the low-level linked list transfer register is the number key of the beginning linked list vertex;
let the result be the link of the beginning linked list vertex converted to a linked list;
delete the beginning linked list vertex;
decide on the result.
To decide what linked list is (A - a linked list) after popping an underlying key (this is popping an underlying key off of a linked list):
let the beginning linked list vertex be A converted to a linked list vertex;
if the beginning linked list vertex is null:
now the low-level linked list transfer register is zero;
decide on an empty linked list;
now the low-level linked list transfer register is the underlying number key of the beginning linked list vertex;
let the result be the link of the beginning linked list vertex converted to a linked list;
delete the beginning linked list vertex;
decide on the result.
To decide what linked list is (A - a linked list) after popping a value (this is popping a value off of a linked list):
let the beginning linked list vertex be A converted to a linked list vertex;
if the beginning linked list vertex is null:
now the low-level linked list transfer register is zero;
decide on an empty linked list;
now the low-level linked list transfer register is the number value of the beginning linked list vertex;
let the result be the link of the beginning linked list vertex converted to a linked list;
delete the beginning linked list vertex;
decide on the result.
To decide what permanent linked list is (A - a permanent linked list) after pushing the key (K - a number) (this is pushing a key onto a permanent linked list):
let the result be a new permanent linked list vertex with the key K and the link A converted to a permanent linked list vertex;
decide on the result converted to a permanent linked list.
To decide what permanent linked list is (A - a permanent linked list) after pushing the key (K - a value):
let the result be a new permanent linked list vertex with the key K and the link A converted to a permanent linked list vertex;
decide on the result converted to a permanent linked list.
To decide what permanent linked list is (A - a permanent linked list) after pushing the key (K - a number) and the underlying key (U - a number) (this is pushing a key and underlying key onto a permanent linked list):
let the result be a new permanent linked list vertex with the key K and the underlying key U and the link A converted to a permanent linked list vertex;
decide on the result converted to a permanent linked list.
To decide what permanent linked list is (A - a permanent linked list) after pushing the key (K - a value) and the underlying key (U - a value):
let the result be a new permanent linked list vertex with the key K and the underlying key U and the link A converted to a permanent linked list vertex;
decide on the result converted to a permanent linked list.
To decide what permanent linked list is (A - a permanent linked list) after pushing the key (K - a number) and the value (V - a number) (this is pushing a key and value onto a permanent linked list):
let the result be a new permanent linked list vertex with the key K and the value V and the link A converted to a permanent linked list vertex;
decide on the result converted to a permanent linked list.
To decide what permanent linked list is (A - a permanent linked list) after pushing the key (K - a value) and the value (V - a value):
let the result be a new permanent linked list vertex with the key K and the value V and the link A converted to a permanent linked list vertex;
decide on the result converted to a permanent linked list.
To decide what permanent linked list is (A - a permanent linked list) after pushing the key (K - a number) and the underlying key (U - a number) and the value (V - a number) (this is pushing a key and underlying key and value onto a permanent linked list):
let the result be a new permanent linked list vertex with the key K and the underlying key U and the value V and the link A converted to a permanent linked list vertex;
decide on the result converted to a permanent linked list.
To decide what permanent linked list is (A - a permanent linked list) after pushing the key (K - a value) and the underlying key (U - a value) and the value (V - a value):
let the result be a new permanent linked list vertex with the key K and the underlying key U and the value V and the link A converted to a permanent linked list vertex;
decide on the result converted to a permanent linked list.
Section "Pushing"
[@]
To push the key (K - a value) onto (A - a linked list): (- {A} = (llo_getField((+ pushing a key onto a linked list +), 1))({A}, {K}); -).
To push the key (K - a value) and the underlying key (U - a value) onto (A - a linked list): (- {A} = (llo_getField((+ pushing a key and underlying key onto a linked list +), 1))({A}, {K}, {U}); -).
To push the textual key (K - some text) onto (A - a linked list): (- {A} = (llo_getField((+ pushing a key and underlying key onto a linked list +), 1))({A}, llo_stringHash32({K}), {K}); -).
To push the key (K - a value) and the value (V - a value) onto (A - a linked list): (- {A} = (llo_getField((+ pushing a key and value onto a linked list +), 1))({A}, {K}, {V}); -).
To push the key (K - a value) and the underlying key (U - a value) and the value (V - a value) onto (A - a linked list): (- {A} = (llo_getField((+ pushing a key and underlying key and value onto a linked list +), 1))({A}, {K}, {U}, {V}); -).
To push the textual key (K - some text) and the value (V - a value) onto (A - a linked list): (- {A} = (llo_getField((+ pushing a key and underlying key and value onto a linked list +), 1))({A}, llo_stringHash32({K}), {K}, {V}); -).
To push the key (K - a value) onto (A - a permanent linked list): (- {A} = (llo_getField((+ pushing a key onto a permanent linked list +), 1))({A}, {K}); -).
To push the key (K - a value) and the underlying key (U - a value) onto (A - a permanent linked list): (- {A} = (llo_getField((+ pushing a key and underlying key onto a permanent linked list +), 1))({A}, {K}, {U}); -).
To push the textual key (K - some text) onto (A - a permanent linked list): (- {A} = (llo_getField((+ pushing a key and underlying key onto a permanent linked list +), 1))({A}, llo_stringHash32({K}), {K}); -).
To push the key (K - a value) and the value (V - a value) onto (A - a permanent linked list): (- {A} = (llo_getField((+ pushing a key and value onto a permanent linked list +), 1))({A}, {K}, {V}); -).
To push the key (K - a value) and the underlying key (U - a value) and the value (V - a value) onto (A - a permanent linked list): (- {A} = (llo_getField((+ pushing a key and underlying key and value onto a permanent linked list +), 1))({A}, {K}, {U}, {V}); -).
To push the textual key (K - some text) and the value (V - a value) onto (A - a permanent linked list): (- {A} = (llo_getField((+ pushing a key and underlying key and value onto a permanent linked list +), 1))({A}, llo_stringHash32({K}), {K}, {V}); -).
Section "Popping"
[@]
To decide what linked list vertex is a linked list vertex popped off of (A - a linked list): (- ({A} = (llo_getField((+ popping a linked list vertex off of a linked list +), 1))({A}), llll_transfer) -).
To decide what K is a/an (D - a description of values of kind K) key popped off of (A - a linked list): (- ({A} = (llo_getField((+ popping a key off of a linked list +), 1))({A}), llll_transfer) -).
To decide what K is an underlying (D - a description of values of kind K) key popped off of (A - a linked list): (- ({A} = (llo_getField((+ popping an underlying key off of a linked list +), 1))({A}), llll_transfer) -).
To decide what K is a/an (D - a description of values of kind K) value popped off of (A - a linked list): (- ({A} = (llo_getField((+ popping a value off of a linked list +), 1))({A}), llll_transfer) -).
Chapter "Queue Interface"
Section "Linked List Transformations used by the Queue Interface" - unindexed
To decide what linked list tail is (B - a linked list tail) after enqueuing the key (K - a number) (this is enqueuing a key in a linked list):
let the new end linked list vertex be a new linked list vertex with the key K and the link a null linked list vertex;
let the old end linked list vertex be B converted to a linked list vertex;
if the old end linked list vertex is not null:
write the link new end linked list vertex to the old end linked list vertex;
decide on the new end linked list vertex converted to a linked list tail.
To decide what linked list tail is (B - a linked list tail) after enqueuing the key (K - a value):
let the new end linked list vertex be a new linked list vertex with the key K and the link a null linked list vertex;
let the old end linked list vertex be B converted to a linked list vertex;
if the old end linked list vertex is not null:
write the link new end linked list vertex to the old end linked list vertex;
decide on the new end linked list vertex converted to a linked list tail.
To decide what linked list tail is (B - a linked list tail) after enqueuing the key (K - a number) and the underlying key (U - a number) (this is enqueuing a key and underlying key in a linked list):
let the new end linked list vertex be a new linked list vertex with the key K and the underlying key U and the link a null linked list vertex;
let the old end linked list vertex be B converted to a linked list vertex;
if the old end linked list vertex is not null:
write the link new end linked list vertex to the old end linked list vertex;
decide on the new end linked list vertex converted to a linked list tail.
To decide what linked list tail is (B - a linked list tail) after enqueuing the key (K - a value) and the underlying key (U - a value):
let the new end linked list vertex be a new linked list vertex with the key K and the underlying key U and the link a null linked list vertex;
let the old end linked list vertex be B converted to a linked list vertex;
if the old end linked list vertex is not null:
write the link new end linked list vertex to the old end linked list vertex;
decide on the new end linked list vertex converted to a linked list tail.
To decide what linked list tail is (B - a linked list tail) after enqueuing the key (K - a number) and the value (V - a number) (this is enqueuing a key and value in a linked list):
let the new end linked list vertex be a new linked list vertex with the key K and the value V and the link a null linked list vertex;
let the old end linked list vertex be B converted to a linked list vertex;
if the old end linked list vertex is not null:
write the link new end linked list vertex to the old end linked list vertex;
decide on the new end linked list vertex converted to a linked list tail.
To decide what linked list tail is (B - a linked list tail) after enqueuing the key (K - a value) and the value (V - a value):
let the new end linked list vertex be a new linked list vertex with the key K and the value V and the link a null linked list vertex;
let the old end linked list vertex be B converted to a linked list vertex;
if the old end linked list vertex is not null:
write the link new end linked list vertex to the old end linked list vertex;
decide on the new end linked list vertex converted to a linked list tail.
To decide what linked list tail is (B - a linked list tail) after enqueuing the key (K - a number) and the underlying key (U - a number) and the value (V - a number) (this is enqueuing a key and underlying key and value in a linked list):
let the new end linked list vertex be a new linked list vertex with the key K and the underlying key U and the value V and the link a null linked list vertex;
let the old end linked list vertex be B converted to a linked list vertex;
if the old end linked list vertex is not null:
write the link new end linked list vertex to the old end linked list vertex;
decide on the new end linked list vertex converted to a linked list tail.
To decide what linked list tail is (B - a linked list tail) after enqueuing the key (K - a value) and the underlying key (U - a value) and the value (V - a value):
let the new end linked list vertex be a new linked list vertex with the key K and the underlying key U and the value V and the link a null linked list vertex;
let the old end linked list vertex be B converted to a linked list vertex;
if the old end linked list vertex is not null:
write the link new end linked list vertex to the old end linked list vertex;
decide on the new end linked list vertex converted to a linked list tail.
To decide what permanent linked list tail is (B - a permanent linked list tail) after enqueuing the key (K - a number) (this is enqueuing a key in a permanent linked list):
let the new end permanent linked list vertex be a new permanent linked list vertex with the key K and the link a null permanent linked list vertex;
let the old end permanent linked list vertex be B converted to a permanent linked list vertex;
if the old end permanent linked list vertex is not null:
write the link new end permanent linked list vertex to the old end permanent linked list vertex;
decide on the new end permanent linked list vertex converted to a permanent linked list tail.
To decide what permanent linked list tail is (B - a permanent linked list tail) after enqueuing the key (K - a value):
let the new end permanent linked list vertex be a new permanent linked list vertex with the key K and the link a null permanent linked list vertex;
let the old end permanent linked list vertex be B converted to a permanent linked list vertex;
if the old end permanent linked list vertex is not null:
write the link new end permanent linked list vertex to the old end permanent linked list vertex;
decide on the new end permanent linked list vertex converted to a permanent linked list tail.
To decide what permanent linked list tail is (B - a permanent linked list tail) after enqueuing the key (K - a number) and the underlying key (U - a number) (this is enqueuing a key and underlying key in a permanent linked list):
let the new end permanent linked list vertex be a new permanent linked list vertex with the key K and the underlying key U and the link a null permanent linked list vertex;
let the old end permanent linked list vertex be B converted to a permanent linked list vertex;
if the old end permanent linked list vertex is not null:
write the link new end permanent linked list vertex to the old end permanent linked list vertex;
decide on the new end permanent linked list vertex converted to a permanent linked list tail.
To decide what permanent linked list tail is (B - a permanent linked list tail) after enqueuing the key (K - a value) and the underlying key (U - a value):
let the new end permanent linked list vertex be a new permanent linked list vertex with the key K and the underlying key U and the link a null permanent linked list vertex;
let the old end permanent linked list vertex be B converted to a permanent linked list vertex;
if the old end permanent linked list vertex is not null:
write the link new end permanent linked list vertex to the old end permanent linked list vertex;
decide on the new end permanent linked list vertex converted to a permanent linked list tail.
To decide what permanent linked list tail is (B - a permanent linked list tail) after enqueuing the key (K - a number) and the value (V - a number) (this is enqueuing a key and value in a permanent linked list):
let the new end permanent linked list vertex be a new permanent linked list vertex with the key K and the value V and the link a null permanent linked list vertex;
let the old end permanent linked list vertex be B converted to a permanent linked list vertex;
if the old end permanent linked list vertex is not null:
write the link new end permanent linked list vertex to the old end permanent linked list vertex;
decide on the new end permanent linked list vertex converted to a permanent linked list tail.
To decide what permanent linked list tail is (B - a permanent linked list tail) after enqueuing the key (K - a value) and the value (V - a value):
let the new end permanent linked list vertex be a new permanent linked list vertex with the key K and the value V and the link a null permanent linked list vertex;
let the old end permanent linked list vertex be B converted to a permanent linked list vertex;
if the old end permanent linked list vertex is not null:
write the link new end permanent linked list vertex to the old end permanent linked list vertex;
decide on the new end permanent linked list vertex converted to a permanent linked list tail.
To decide what permanent linked list tail is (B - a permanent linked list tail) after enqueuing the key (K - a number) and the underlying key (U - a number) and the value (V - a number) (this is enqueuing a key and underlying key and value in a permanent linked list):
let the new end permanent linked list vertex be a new permanent linked list vertex with the key K and the underlying key U and the value V and the link a null permanent linked list vertex;
let the old end permanent linked list vertex be B converted to a permanent linked list vertex;
if the old end permanent linked list vertex is not null:
write the link new end permanent linked list vertex to the old end permanent linked list vertex;
decide on the new end permanent linked list vertex converted to a permanent linked list tail.
To decide what permanent linked list tail is (B - a permanent linked list tail) after enqueuing the key (K - a value) and the underlying key (U - a value) and the value (V - a value):
let the new end permanent linked list vertex be a new permanent linked list vertex with the key K and the underlying key U and the value V and the link a null permanent linked list vertex;
let the old end permanent linked list vertex be B converted to a permanent linked list vertex;
if the old end permanent linked list vertex is not null:
write the link new end permanent linked list vertex to the old end permanent linked list vertex;
decide on the new end permanent linked list vertex converted to a permanent linked list tail.
Section "Enqueuing"
To enqueue the key (K - a value) in (A - a linked list) through (B - a linked list tail): (- {B} = (llo_getField((+ enqueuing a key in a linked list +), 1))({B}, {K}); if (~~{A}) {A} = {B}; -).
To enqueue the key (K - a value) and the underlying key (U - a value) in (A - a linked list) through (B - a linked list tail): (- {B} = (llo_getField((+ enqueuing a key and underlying key in a linked list +), 1))({B}, {K}, {U}); if (~~{A}) {A} = {B}; -).
To enqueue the textual key (K - some text) in (A - a linked list) through (B - a linked list tail): (- {B} = (llo_getField((+ enqueuing a key and underlying key in a linked list +), 1))({B}, llo_stringHash32({K}), {K}); if (~~{A}) {A} = {B}; -).
To enqueue the key (K - a value) and the value (V - a value) in (A - a linked list) through (B - a linked list tail): (- {B} = (llo_getField((+ enqueuing a key and value in a linked list +), 1))({B}, {K}, {V}); if (~~{A}) {A} = {B}; -).
To enqueue the key (K - a value) and the underlying key (U - a value) and the value (V - a value) in (A - a linked list) through (B - a linked list tail): (- {B} = (llo_getField((+ enqueuing a key and underlying key and value in a linked list +), 1))({B}, {K}, {U}, {V}); if (~~{A}) {A} = {B}; -).
To enqueue the textual key (K - some text) and the value (V - a value) in (A - a linked list) through (B - a linked list tail): (- {B} = (llo_getField((+ enqueuing a key and underlying key and value in a linked list +), 1))({B}, llo_stringHash32({K}), {K}, {V}); if (~~{A}) {A} = {B}; -).
To enqueue the key (K - a value) in (A - a permanent linked list) through (B - a permanent linked list tail): (- {B} = (llo_getField((+ enqueuing a key in a permanent linked list +), 1))({B}, {K}); if (~~{A}) {A} = {B}; -).
To enqueue the key (K - a value) and the underlying key (U - a value) in (A - a permanent linked list) through (B - a permanent linked list tail): (- {B} = (llo_getField((+ enqueuing a key and underlying key in a permanent linked list +), 1))({B}, {K}, {U}); if (~~{A}) {A} = {B}; -).
To enqueue the textual key (K - some text) in (A - a permanent linked list) through (B - a permanent linked list tail): (- {B} = (llo_getField((+ enqueuing a key and underlying key in a permanent linked list +), 1))({B}, llo_stringHash32({K}), {K}); if (~~{A}) {A} = {B}; -).
To enqueue the key (K - a value) and the value (V - a value) in (A - a permanent linked list) through (B - a permanent linked list tail): (- {B} = (llo_getField((+ enqueuing a key and value in a permanent linked list +), 1))({B}, {K}, {V}); if (~~{A}) {A} = {B}; -).
To enqueue the key (K - a value) and the underlying key (U - a value) and the value (V - a value) in (A - a permanent linked list) through (B - a permanent linked list tail): (- {B} = (llo_getField((+ enqueuing a key and underlying key and value in a permanent linked list +), 1))({B}, {K}, {U}, {V}); if (~~{A}) {A} = {B}; -).
To enqueue the textual key (K - some text) and the value (V - a value) in (A - a permanent linked list) through (B - a permanent linked list tail): (- {B} = (llo_getField((+ enqueuing a key and underlying key and value in a permanent linked list +), 1))({B}, llo_stringHash32({K}), {K}, {V}); if (~~{A}) {A} = {B}; -).
Section "Dequeuing"
To decide what linked list vertex is a linked list vertex dequeued from (A - a linked list) through (B - a linked list tail): (- ({A} = (llo_getField((+ popping a linked list vertex off of a linked list +), 1))({A}), {A} || ({B} = 0), llll_transfer) -).
To decide what K is a/an (D - a description of values of kind K) key dequeued from (A - a linked list) through (B - a linked list tail): (- ({A} = (llo_getField((+ popping a key off of a linked list +), 1))({A}), {A} || ({B} = 0), llll_transfer) -).
To decide what K is an underlying (D - a description of values of kind K) key dequeued from (A - a linked list) through (B - a linked list tail): (- ({A} = (llo_getField((+ popping an underlying key off of a linked list +), 1))({A}), {A} || ({B} = 0), llll_transfer) -).
To decide what K is a/an (D - a description of values of kind K) value dequeued from (A - a linked list) through (B - a linked list tail): (- ({A} = (llo_getField((+ popping a value off of a linked list +), 1))({A}), {A} || ({B} = 0), llll_transfer) -).
Chapter "Search Interface"
Section "Linked List Traversals used by the Search Interface" - unindexed
Include (-
[ llll_atOrAfter key address
result;
if (~~address) {
return 0;
}
@linkedsearch
key ! the key to search for
4 ! the size of the key in bytes
address ! the address of the first structure to search
0 ! the offset to the key
12 ! the offset to the link
0 ! the options (no need for special options)
result;
return result;
];
Array llll_keyValuePair --> 0 0;
[ llll_atOrAfterWithValue key value address
result;
if (~~address) {
return 0;
}
llo_setInt(llll_keyValuePair,key);
llo_setField(llll_keyValuePair, 1,value);
@linkedsearch
llll_keyValuePair ! the address of the key to search for
8 ! the size of the key in bytes
address ! the address of the first structure to search
0 ! the offset to the key
12 ! the offset to the link
1 ! the options (the key is given as an address)
result;
return result;
];
[ llll_atOrAfterWithUnderlying key underlyingKey address comparator
result;
comparator = llo_getField(comparator, 1);
for (result = llll_atOrAfter(key, address): result: result = llll_atOrAfter(key, llo_getField(result, 3))) {
if (comparator(underlyingKey, llo_getField(result, 2))) {
break;
}
}
return result;
];
[ llll_atOrAfterSynthetic key underlyingKey address comparator
result;
comparator = llo_getField((+ testing equality between synthetic text and text +), 1);
for (result = llll_atOrAfter(key, address): result: result = llll_atOrAfter(key, llo_getField(result, 3))) {
if (comparator(underlyingKey, llo_getField(result, 2))) {
break;
}
}
return result;
];
[ llll_atOrAfterWithBoth key underlyingKey value address comparator
result;
comparator = llo_getField(comparator, 1);
for (result = llll_atOrAfterWithValue(key, value, address): result: result = llll_atOrAfterWithValue(key, value, llo_getField(result, 3))) {
if (comparator(underlyingKey, llo_getField(result, 2))) {
break;
}
}
return result;
];
-).
Section "Searching by Key"
To decide what linked list vertex is the first match for the key (K - a value) in (A - a linked list): (- llll_atOrAfter({K}, {A}) -).
To decide what linked list vertex is the first match for the key (K - a value) at or after (A - a linked list vertex): (- llll_atOrAfter({K}, {A}) -).
To decide what linked list vertex is the first match for the key (K - a value) after (A - a linked list vertex):
if A is null:
decide on a null linked list vertex;
decide on the first match for the key K at or after the link of A.
To decide what permanent linked list vertex is the first match for the key (K - a value) in (A - a permanent linked list): (- llll_atOrAfter({K}, {A}) -).
To decide what permanent linked list vertex is the first match for the key (K - a value) at or after (A - a permanent linked list vertex): (- llll_atOrAfter({K}, {A}) -).
To decide what permanent linked list vertex is the first match for the key (K - a value) after (A - a permanent linked list vertex):
if A is null:
decide on a null permanent linked list vertex;
decide on the first match for the key K at or after the link of A.
Section "Searching by Underlying Key"
To decide what linked list vertex is the first match for the key (K - a value) and the underlying key (U - a value) in (A - a linked list) with the comparator (P - a phrase (value of kind K, K) -> nothing [@] [truth state]): (- llll_atOrAfterWithUnderlying({K}, {U}, {A}, {P}) -).
To decide what linked list vertex is the first match for the synthetic textual key (K - some text) in (A - a linked list): (- llll_atOrAfterSynthetic(llo_stringHash32({K}), {K}, {A}) -).
To decide what linked list vertex is the first match for the textual key (K - some text) in (A - a linked list) (this is finding the first match for a textual key in a linked list):
let the key be a new synthetic text copied from K;
let the result be the first match for the synthetic textual key key in A;
delete the synthetic text key;
decide on the result.
To decide what linked list vertex is the first match for the key (K - a value) and the underlying key (U - a value) at or after (A - a linked list vertex) with the comparator (P - a phrase (value of kind K, K) -> nothing [@] [truth state]): (- llll_atOrAfterWithUnderlying({K}, {U}, {A}, {P}) -).
To decide what linked list vertex is the first match for the synthetic textual key (K - some text) at or after (A - a linked list vertex): (- llll_atOrAfterSynthetic(llo_stringHash32({K}), {K}, {A}) -).
To decide what linked list vertex is the first match for the textual key (K - some text) at or after (A - a linked list vertex) (this is finding a loosely subsequent match for a textual key in a linked list):
let the key be a new synthetic text copied from K;
let the result be the first match for the synthetic textual key key at or after A;
delete the synthetic text key;
decide on the result.
To decide what linked list vertex is the first match for the key (K - a value) and the underlying key (U - a value) after (A - a linked list vertex) with the comparator (P - a phrase (value of kind K, K) -> nothing [@] [truth state]):
if A is null:
decide on a null linked list vertex;
decide on the first match for the key K and the underlying key U at or after the link of A with the comparator P.
To decide what linked list vertex is the first match for the synthetic textual key (K - some text) after (A - a linked list vertex) (this is finding a subsequent match for a synthetic textual key in a linked list):
if A is null:
decide on a null linked list vertex;
decide on the first match for the synthetic textual key K at or after the link of A.
To decide what linked list vertex is the first match for the textual key (K - some text) after (A - a linked list vertex) (this is finding a subsequent match for a textual key in a linked list):
if A is null:
decide on a null linked list vertex;
decide on the first match for the textual key K at or after the link of A.
To decide what permanent linked list vertex is the first match for the key (K - a value) and the underlying key (U - a value) in (A - a permanent linked list) with the comparator (P - a phrase (value of kind K, K) -> nothing [@] [truth state]): (- llll_atOrAfterWithUnderlying({K}, {U}, {A}, {P}) -).
To decide what permanent linked list vertex is the first match for the synthetic textual key (K - some text) in (A - a permanent linked list): (- llll_atOrAfterSynthetic(llo_stringHash32({K}), {K}, {A}) -).
To decide what permanent linked list vertex is the first match for the textual key (K - some text) in (A - a permanent linked list) (this is finding the first match for a textual key in a permanent linked list):
let the key be a new synthetic text copied from K;
let the result be the first match for the synthetic textual key key in A;
delete the synthetic text key;
decide on the result.
To decide what permanent linked list vertex is the first match for the key (K - a value) and the underlying key (U - a value) at or after (A - a permanent linked list vertex) with the comparator (P - a phrase (value of kind K, K) -> nothing [@] [truth state]): (- llll_atOrAfterWithUnderlying({K}, {U}, {A}, {P}) -).
To decide what permanent linked list vertex is the first match for the synthetic textual key (K - some text) at or after (A - a permanent linked list vertex): (- llll_atOrAfterSynthetic(llo_stringHash32({K}), {K}, {A}) -).
To decide what permanent linked list vertex is the first match for the textual key (K - some text) at or after (A - a permanent linked list vertex) (this is finding a loosely subsequent match for a textual key in a permanent linked list):
let the key be a new synthetic text copied from K;
let the result be the first match for the synthetic textual key key at or after A;
delete the synthetic text key;
decide on the result.
To decide what permanent linked list vertex is the first match for the key (K - a value) and the underlying key (U - a value) after (A - a permanent linked list vertex) with the comparator (P - a phrase (value of kind K, K) -> nothing [@] [truth state]):
if A is null:
decide on a null permanent linked list vertex;
decide on the first match for the key K and the underlying key U at or after the link of A with the comparator P.
To decide what permanent linked list vertex is the first match for the synthetic textual key (K - some text) after (A - a permanent linked list vertex) (this is finding a subsequent match for a synthetic textual key in a permanent linked list):
if A is null:
decide on a null permanent linked list vertex;
decide on the first match for the synthetic textual key K at or after the link of A.
To decide what permanent linked list vertex is the first match for the textual key (K - some text) after (A - a permanent linked list vertex) (this is finding a subsequent match for a textual key in a permanent linked list):
if A is null:
decide on a null permanent linked list vertex;
decide on the first match for the textual key K at or after the link of A.
Section "Searching by Key and Value"
To decide what linked list vertex is the first match for the key (K - a value) and the value (V - a value) in (A - a linked list): (- llll_atOrAfterWithValue({K}, {V}, {A}) -).
To decide what linked list vertex is the first match for the key (K - a value) and the value (V - a value) at or after (A - a linked list vertex): (- llll_atOrAfterWithValue({K}, {V}, {A}) -).
To decide what linked list vertex is the first match for the key (K - a value) and the value (V - a value) after (A - a linked list vertex):
if A is null:
decide on a null linked list vertex;
decide on the first match for the key K and the value V at or after the link of A.
To decide what permanent linked list vertex is the first match for the key (K - a value) and the value (V - a value) in (A - a permanent linked list): (- llll_atOrAfterWithValue({K}, {V}, {A}) -).
To decide what permanent linked list vertex is the first match for the key (K - a value) and the value (V - a value) at or after (A - a permanent linked list vertex): (- llll_atOrAfterWithValue({K}, {V}, {A}) -).
To decide what permanent linked list vertex is the first match for the key (K - a value) and the value (V - a value) after (A - a permanent linked list vertex):
if A is null:
decide on a null permanent linked list vertex;
decide on the first match for the key K and the value V at or after the link of A.
Section "Searching by Underlying Key and Value"
To decide what linked list vertex is the first match for the key (K - a value) and the underlying key (U - a value) and the value (V - a value) in (A - a linked list) with the comparator (P - a phrase (value of kind K, K) -> nothing [@] [truth state]): (- llll_atOrAfterWithBoth({K}, {U}, {V}, {A}, {P}) -).
To decide what linked list vertex is the first match for the synthetic textual key (K - some text) and the value (V - a value) in (A - a linked list): (- llll_atOrAfterWithBoth(llo_stringHash32({K}), {K}, {V}, {A}, (+ testing equality between synthetic text and text +)) -).
To decide what linked list vertex is the first match for the textual key (K - some text) and the value (V - a value) in (A - a linked list):
let the key be a new synthetic text copied from K;
let the result be the first match for the synthetic textual key key and the value V in A;
delete the synthetic text key;
decide on the result.
To decide what linked list vertex is the first match for the key (K - a value) and the underlying key (U - a value) and the value (V - a value) at or after (A - a linked list vertex) with the comparator (P - a phrase (value of kind K, K) -> nothing [@] [truth state]): (- llll_atOrAfterWithBoth({K}, {U}, {V}, {A}, {P}) -).
To decide what linked list vertex is the first match for the synthetic textual key (K - some text) and the value (V - a value) at or after (A - a linked list vertex): (- llll_atOrAfterWithBoth(llo_stringHash32({K}), {K}, {V}, {A}, (+ testing equality between synthetic text and text +)) -).
To decide what linked list vertex is the first match for the textual key (K - some text) and the value (V - a value) at or after (A - a linked list vertex):
let the key be a new synthetic text copied from K;
let the result be the first match for the synthetic textual key key and the value V at or after A;
delete the synthetic text key;
decide on the result.
To decide what linked list vertex is the first match for the key (K - a value) and the underlying key (U - a value) and the value (V - a value) after (A - a linked list vertex) with the comparator (P - a phrase (value of kind K, K) -> nothing [@] [truth state]):
if A is null:
decide on a null linked list vertex;
decide on the first match for the key K and the underlying key U and the value V at or after the link of A with the comparator P.
To decide what linked list vertex is the first match for the synthetic textual key (K - some text) and the value (V - a value) after (A - a linked list vertex):
if A is null:
decide on a null linked list vertex;
decide on the first match for the synthetic textual key K and the value V at or after the link of A with the comparator P.
To decide what linked list vertex is the first match for the textual key (K - some text) and the value (V - a value) after (A - a linked list vertex):
if A is null:
decide on a null linked list vertex;
decide on the first match for the textual key K and the value V at or after the link of A with the comparator P.
To decide what permanent linked list vertex is the first match for the key (K - a value) and the underlying key (U - a value) and the value (V - a value) in (A - a permanent linked list) with the comparator (P - a phrase (value of kind K, K) -> nothing [@] [truth state]): (- llll_atOrAfterWithBoth({K}, {U}, {V}, {A}, {P}) -).
To decide what permanent linked list vertex is the first match for the synthetic textual key (K - some text) and the value (V - a value) in (A - a permanent linked list): (- llll_atOrAfterWithBoth(llo_stringHash32({K}), {K}, {V}, {A}, (+ testing equality between synthetic text and text +)) -).
To decide what permanent linked list vertex is the first match for the textual key (K - some text) and the value (V - a value) in (A - a permanent linked list):
let the key be a new synthetic text copied from K;
let the result be the first match for the synthetic textual key key and the value V in A;
delete the synthetic text key;
decide on the result.
To decide what permanent linked list vertex is the first match for the key (K - a value) and the underlying key (U - a value) and the value (V - a value) at or after (A - a permanent linked list vertex) with the comparator (P - a phrase (value of kind K, K) -> nothing [@] [truth state]): (- llll_atOrAfterWithBoth({K}, {U}, {V}, {A}, {P}) -).
To decide what permanent linked list vertex is the first match for the synthetic textual key (K - some text) and the value (V - a value) at or after (A - a permanent linked list vertex): (- llll_atOrAfterWithBoth(llo_stringHash32({K}), {K}, {V}, {A}, (+ testing equality between synthetic text and text +)) -).
To decide what permanent linked list vertex is the first match for the textual key (K - some text) and the value (V - a value) at or after (A - a permanent linked list vertex):
let the key be a new synthetic text copied from K;
let the result be the first match for the synthetic textual key key and the value V at or after A;
delete the synthetic text key;
decide on the result.
To decide what permanent linked list vertex is the first match for the key (K - a value) and the underlying key (U - a value) and the value (V - a value) after (A - a permanent linked list vertex) with the comparator (P - a phrase (value of kind K, K) -> nothing [@] [truth state]):
if A is null:
decide on a null permanent linked list vertex;
decide on the first match for the key K and the underlying key U and the value V at or after the link of A with the comparator P.
To decide what permanent linked list vertex is the first match for the synthetic textual key (K - some text) and the value (V - a value) after (A - a permanent linked list vertex):
if A is null:
decide on a null permanent linked list vertex;
decide on the first match for the synthetic textual key K and the value V at or after the link of A with the comparator P.
To decide what permanent linked list vertex is the first match for the textual key (K - some text) and the value (V - a value) after (A - a permanent linked list vertex):
if A is null:
decide on a null permanent linked list vertex;
decide on the first match for the textual key K and the value V at or after the link of A with the comparator P.
Chapter "Map Interface"
Section "Linked List Traversals used by the Map Interface" - unindexed
To decide what linked list vertex is the linked list vertex just before (B - a linked list vertex) in (A - a linked list): (- llll_justBefore({A}, {B}) -).
To decide what permanent linked list vertex is the permanent linked list vertex just before (B - a permanent linked list vertex) in (A - a permanent linked list): (- llll_justBefore({A}, {B}) -).
Section "Linked List Transformations used by the Map Interface" - unindexed
To decide what linked list is (A - a linked list) after removing (B - a linked list vertex) (this is removing a vertex from a linked list):
if B is null:
decide on A;
let the predecessor linked list vertex be the linked list vertex just before B in A;
let the successor linked list vertex be the link of B;
delete B;
if the predecessor linked list vertex is null:
decide on the successor linked list vertex converted to a linked list;
write the link successor linked list vertex to the predecessor linked list vertex;
decide on A.
Section "Map Operations by Key"
To decide whether (A - a linked list) contains the key (K - a value):
decide on whether or not the first match for the key K in A is not null.
To decide what K is the first (D - a description of values of kind K) value matching the key (K - a value) in (A - a linked list) or (V - a K) if there are no matches:
let the linked list vertex be the first match for the key K in A;
if the linked list vertex is null:
decide on V;
decide on the D value of the linked list vertex.
To remove the first occurrence of the key (K - a value) from (A - a linked list): (- {A} = (llo_getField((+ removing a vertex from a linked list +), 1))({A}, llll_atOrAfter({K}, {A})); -).
To decide whether (A - a permanent linked list) contains the key (K - a value):
decide on whether or not the first match for the key K in A is not null.
To decide what K is the first (D - a description of values of kind K) value matching the key (K - a value) in (A - a permanent linked list) or (V - a K) if there are no matches:
let the permanent linked list vertex be the first match for the key K in A;
if the permanent linked list vertex is null:
decide on V;
decide on the D value of the permanent linked list vertex.
Section "Map Operations by Underlying Key"
To decide whether (A - a linked list) contains the key (K - a value) and the underlying key (U - a value) with the comparator (P - a phrase (value of kind K, K) -> nothing [@] [truth state]):
decide on whether or not the first match for the key K and the underlying key U in A with the comparator P is not null.
To decide whether (A - a linked list) contains the synthetic textual key (K - some text) (this is testing synthetic textual key presence in a linked list):
decide on whether or not the first match for the synthetic textual key K in A is not null.
To decide whether (A - a linked list) contains the textual key (K - some text) (this is testing textual key presence in a linked list):
decide on whether or not the first match for the textual key K in A is not null.
To decide what K is the first (D - a description of values of kind K) value matching the key (K - a value) and the underlying key (U - a value) in (A - a linked list) with the comparator (P - a phrase (value of kind L, L) -> nothing [@] [truth state]) or (V - a K) if there are no matches: