aboutsummaryrefslogtreecommitdiffstats
path: root/doc/expert/det_sort
diff options
context:
space:
mode:
Diffstat (limited to 'doc/expert/det_sort')
-rw-r--r--doc/expert/det_sort41
1 files changed, 20 insertions, 21 deletions
diff --git a/doc/expert/det_sort b/doc/expert/det_sort
index 25c1392..3b71918 100644
--- a/doc/expert/det_sort
+++ b/doc/expert/det_sort
@@ -38,21 +38,22 @@ while at another point we insert
How the page numbers are worked out is not relevant here. Clearly we
would like to merge these two entries into one entry that comes out as
@ID "Aardvarks, 23, 359"
-The following definition will merge two objects in this way:
-@ID @OneRow @Code {
-"def @Merge left x right y"
-"{"
-" {x @Rump y} @Case"
-" {"
-" \"\" @Yield x"
-" else @Yield { x, x @Rump y }"
-" }"
-"}"
+The following definition will merge two objects @Code x and
+@Code y in this way:
+@ID @OneRow @Code @Verbatim {
+def @Merge left x right y
+{
+ { x @Rump { x @Meld y } } @Case
+ {
+ "" @Yield x
+ else @Yield { { x{@OneCol ,} } @Meld y }
+ }
+
+}
}
-The @@Rump symbol is the subject of Section {@NumberOf rump}; this
-says `if the two things to be merged are equal, the result is one
-of them; otherwise it is the first followed by a comma and space
-and then the rump of the second.' Our only problem is that this
+The @@Rump and @@Meld symbols are the subject of Section {@NumberOf rump};
+and a detailed explanation of how this definition works is the subject
+of Section {@NumberOf exa_inde}. Our only problem is that this
symbol has to be applied to two galleys from widely separated
parts of the document.
@PP
@@ -73,13 +74,11 @@ the merging in a different order: it merges @Eq { n } galleys
by merging the first @Eq { lfloor n slash 2 rfloor } together,
then the last @Eq { lceil n slash 2 rceil } together, then
merging the result. Of course, if the @@Merge symbol is
-associative this has the same effect. The @@Merge symbol above
-is not strictly associative, but it is close enough in practice. The
-total time it takes to merge @Eq { n } galleys with equal keys
-is @Eq { O ( n sup 2 ) } or somewhat higher (but always polynomial
-in @Eq { n }) depending on how many times the parameters occur
-within the body of @@Merge; to do it in the natural linear order
-would take Lout exponential time.
+associative this has the same effect. The total time it takes
+to merge @Eq { n } galleys with equal keys is @Eq { O ( n sup 2 ) }
+or somewhat higher (but always polynomial in @Eq { n }) depending
+on how many times the parameters occur within the body of @@Merge;
+to do it in the natural linear order would take Lout exponential time.
@PP
For horrible reasons concerning making it possible to print reference
lists sorted by point of first citation, the particular sort key