2title = "2f: Noun Ordering"
10Computes whether `a` and `b` are in alphabetical order, producing a flag.
37 =+ [c=(end 3 1 a) d=(end 3 1 b)]
39 $(a (rsh 3 1 a), b (rsh 3 1 b))
61 > (aor "abcdefz" "abcdefa")
64 > (aor "abcdefa" "abcdefz")
80Computes whether `a` and `b` are in ascending numeric order, producing a flag.
118 > (dor ~[1 2 3] ~[1 2 4])
121 > (dor ~[1 2 4] ~[1 2 3])
124 > (dor `(list @)`~[99 100 10.000] ~[99 101 10.000])
127 > (dor ~[99 101 10.999] `(list @)`~[99 100 10.000])
133If `a` and `b` are both atoms, `dor` is equivalent to [`lte`](@/docs/reference/library/1a.md). If they're
134cells, `dor` recurses on the heads, and then if the heads are the same it checks
137If one sample is a cell and the other is an atom, the cell sample is treated as
146Computes whether of `(mug a)` and `(mug b)` are in ascending numeric order,
147producing a flag. If the `mug` hashes are equal, `a` and `b` are compared by
150[`mug`](@/docs/reference/library/2e.md) is the the 31-bit nonzero FNV-1a hash algorithm.
169 =+ [c=(mug a) d=(mug b)]
208 > (gor (some 10) `(list @)`[1 2 3 ~])
214`map`s use `gor` on the key for horizontal ordering and `vor` for
215vertical order. `map`s only look at the keys (the head of the key-value pair
216elements) for ordering.
223If `a` and `b` are atoms, they are computed as samples of `gor`, producing a
226If `a` and `b` are cells, `hor` checks to see if their heads are equal. If their
227heads are equal, `gor` is computed on their tails, producing a flag. If their
228heads are not equal, `gor` is computed on their heads, producing a flag.
230If `a` is an atom and `b` is not, then `%.y` is produced. If `b` is an atom and
231`a` is not, `%.n` is produced.
280 > (hor 500.000.000 "foo")
283 > (hor "foo" 500.000.000)
289 > (gor `(list @)`[0 ~] 1)
292 > (hor `(list @)`[50 500 5.000 ~] 1)
298Sets (+set, +in) use `hor` for their horizontal order and `vor` for their
299vertical order. See [`apt:in`](@/docs/reference/library/2h.md) to see how a set verifies its correctness.
300`vor` is used to verify.
307Computes whether the corresponding legs of `a` and `b` are in ascending
308numeric order, producing a flag.
348 > (lor `(list @)`[1 2 3 ~] `(list @)`[1 2 3 4 ~])
351 > (lor `(list @)`[1 2 3 ~] `(list @)`[1 2 2 ~])
354 > (lor `(list @)`[1 2 3 ~] `(list @)`[2 2 ~])
357 > (lor [2 2 5] [1 5 9 8])
360 > (lor [1 5 8] [1 5 9 8])
363 > (lor [1 2 3] [1 2])
369`lor` is no longer used internally.
376Computes whether the double-hashes `(mug (mug a))` and `(mug (mug b))` are in
377ascending numeric order, producing a flag. If the double-`mug` hashes are
378equal, `a` and `b` are compared by `dor` instead.
380[`mug`](@/docs/reference/library/2e.md) is the the 31-bit nonzero FNV-1a hash algorithm.
400 =+ [c=(mug (mug a)) d=(mug (mug b))]
412 > [(mug 'f') (mug 'g')]
413 [1.661.740.952 1.644.963.335]
415 > [(mug (mug 'f')) (mug (mug 'g'))]
416 [261.421.509 1.861.258.547]
421 > (vor 43.326 41.106)
427Maps, sets, and queues all use `vor` to check for vertical ordering. Maps and
428sets also use `gor` and `hor` for horizontal order, respectively, but queues use
429vertical ordering alone.
431Since hashing removes correlation, double-`mug`ging with `vor` removes
432correlation with single-`mug`ged `hor`. Vertical order becomes uncorrelated
433with horizontal order.
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list