@@ -6,7 +6,7 @@ navhome: /docs/
6# 2f: noun ordering
6# 2f: noun ordering
9−Alphabetic order
9+Alphabetical order
11Computes whether `a` and `b` are in alphabetical order, producing a flag.
11Computes whether `a` and `b` are in alphabetical order, producing a flag.
@@ -123,6 +123,14 @@ A flag.
123 > (dor ~[99 101 10.999] `(list @)`~[99 100 10.000])
123 > (dor ~[99 101 10.999] `(list @)`~[99 100 10.000])
128+If `a` and `b` are both atoms, `dor` is equivalent to [`lte`](../1a). If they're
129+cells, `dor` recurses on the heads, and then if the heads are the same it checks
132+If one sample is a cell and the other is an atom, the cell sample is treated as
@@ -130,8 +138,9 @@ A flag.
131Hash order
139Hash order
133−Computes whether the products of `a` and `b` hashed with `mug` are in
141+Computes whether of `(mug a)` and `(mug b)` are in ascending numeric order,
134−ascending numeric order, producing a flag.
142+producing a flag. If the `mug` hashes are equal, `a` and `b` are compared by
136[`mug`](../2e) is the the 31-bit nonzero FNV-1a hash algorithm.
145[`mug`](../2e) is the the 31-bit nonzero FNV-1a hash algorithm.
@@ -192,20 +201,24 @@ A flag.
192 > (gor (some 10) `(list @)`[1 2 3 ~])
201 > (gor (some 10) `(list @)`[1 2 3 ~])
206+`map`s use `gor` on the key for horizontal ordering and `vor` for
207+vertical order. `map`s only look at the keys (the head of the key-value pair
208+elements) for ordering.
198### `++hor`
211### `++hor`
200−Head/tail hash order
213+Horizontal hash order
215+If `a` and `b` are atoms, they are computed as samples of `gor`, producing a
202If `a` and `b` are cells, `hor` checks to see if their heads are equal. If their
218If `a` and `b` are cells, `hor` checks to see if their heads are equal. If their
203heads are equal, `gor` is computed on their tails, producing a flag. If their
219heads are equal, `gor` is computed on their tails, producing a flag. If their
204heads are not equal, `gor` is computed on their heads, producing a flag.
220heads are not equal, `gor` is computed on their heads, producing a flag.
206−If `a` and `b` are atoms, they are computed as samples of `gor`, producing a
209If `a` is an atom and `b` is not, then `%.y` is produced. If `b` is an atom and
222If `a` is an atom and `b` is not, then `%.y` is produced. If `b` is an atom and
210`a` is not, `%.n` is produced.
223`a` is not, `%.n` is produced.
@@ -270,6 +283,11 @@ A flag.
288+Sets (+set, +in) use `hor` for their horizontal order and `vor` for their
289+vertical order. See [`apt:in`](../2h) to see how a set verifies its correctness.
290+`vor` is used to verify.
275### `++lor`
293### `++lor`
@@ -312,7 +330,7 @@ A flag.
312 > (lor 2 1)
330 > (lor 2 1)
315− > (lor 9 [1 2]) :: lor computes cells as greater than atoms
333+ > (lor 9 [1 2])
318 > (lor `(list @)`[1 2 3 ~] `(list @)`[1 2 3 4 ~])
336 > (lor `(list @)`[1 2 3 ~] `(list @)`[1 2 3 4 ~])
@@ -327,21 +345,25 @@ A flag.
327 > (lor [2 2 5] [1 5 9 8])
345 > (lor [2 2 5] [1 5 9 8])
330− > (lor [1 4 8] [1 5 9 8])
348+ > (lor [1 5 8] [1 5 9 8])
333 > (lor [1 2 3] [1 2])
351 > (lor [1 2 3] [1 2])
357+`lor` is no longer used internally.
339### `++vor`
360### `++vor`
341−Double hash order
362+Vertical order
343−Computes whether the products of `a` and `b` double-hashed with `mug` are in
364+Computes whether the double-hashes `(mug (mug a))` and `(mug (mug b))` are in
344−ascending numeric order, producing a flag.
365+ascending numeric order, producing a flag. If the double-`mug` hashes are
366+equal, `a` and `b` are compared by `dor` instead.
346[`mug`](../2e) is the the 31-bit nonzero FNV-1a hash algorithm.
368[`mug`](../2e) is the the 31-bit nonzero FNV-1a hash algorithm.
@@ -386,5 +408,15 @@ A flag.
413+Maps, sets, and queues all use `vor` to check for vertical ordering. Maps and
414+sets also use `gor` and `hor` for horizontal order, respectively, but queues use
415+vertical ordering alone.
417+Since hashing removes correlation, double-`mug`ging with `vor` removes
418+correlation with single-`mug`ged `hor`. Vertical order becomes uncorrelated
419+with horizontal order.