## Chapter 4.5: Comparisons & Logic

[TOP] [UP] [PREV] [NEXT]

- $and(a b ...)
- Evaluates to the logical "and" of
aandband ... May have any number of arguments.- $or(a b ...)
- Evaluates to the logical "or" of
aandband ... May have any number of arguments.- $not(a)
- Evaluates to the logical negation of
a.- $equal(x y)
- If
xandyare identical (they may be numbers or strings), evaluates to "1". Otherwise it is "0".Note: $equal() expects thatxandydonotcontain blanks; if they do, the results are unpredictable. If you must compare multi-word strings, see $quote().- $not_equal(x y)
- Reverse of $equal().
- $empty(str)
- Evaluates to "1" if
stris completely empty, and "0" otherwise.- $not_empty(str)
- Evalutates to "1" if
stris not empty, and "0" if it is completely empty.- $if(a b c)
- If
ais true, evaluates tob. Otherwise, evaluates toc. The classic triadic "if then else" operator. Argumentsaandbmust be only one word;cmay be any length.- $ifthen(a b)
- If
ais a number != 0, evaluates tob; otherwise nothing.Bmay be of any length. (For some cases, this function may be more convenient than $if().) Note that anaof "Junk" or "0" is considered false, whereas "17" or "5words" are both "true".- $gen_sort(direction words...)
- Sorts the list of
wordsin ascending (direction> 0) alphabetical order, or descending (direction< 0) alphabetical order. Evaluates to a list of indices to the original list, in sorted order. I.e., $gen_sort (1 a c b) evaluates to "1 3 2".- $num_sort(direction numbers...)
- If
directionis > 0, evaluates to the list of numbers, sorted in ascending numerical order. If direction is < 0, descending numerical order is used.- $triplet_sort(direction triplet_list...)
- If
directionis > 0, evaluates to the list of item triplets, sorted in ascending numerical order. If direction is < 0, descending numerical order is used. In this case, numerical order means the conference number is considered first, then the item number, and finally the response number.- $item_sort(direction code triplet_list...)
- Evaluates to a sorted triplet list of items. If
directionis > 0, sorting is done in ascending order; if < 0, descending order.

Codeselects the property used to sort the items. A value of 1 sorts the items alphabetically by title. A value of 2 sorts alphabetically by the author's full name. A value of 3 sorts by the date of the last (undeleted) response to the item. (Forcode1 and 2, the items must all be in the same conference, or the results will be unpredictable.)