| OCR Text |
Show (DEFUN ODD-COL-ODD-ROW (X Y) (AND (ODDP X) (ODDP Y))) (DEFUN ODD-COL-EVEN-ROW (X Y) (AND (ODDP X) (EVENP Y) ) ) (DEFUN EVEN-COL-ODD-ROW (X Y) (AND (EVENP X) (ODDP Y) ) ) (DEFUN EVEN-COL-EVEN-ROW (X Y) (AND (EVENP X) (EVENP Y) ) ) (DEFUN ODD-COL (X IGNORE) (AND (ODDP X) ) ) (DEFUN EVEN-COL (X IGNORE) (AND (EVENP X) ) ) (DEFUN ODD-ROW (IGNORE Y) (AND ( ODDP Y) ) ) (DEFUN EVEN-ROW (IGNORE Y) (AND (EVENP Y))) (DEFUN ANY (IGNORE IGNORE) (AND)) Figure 4: Nine Possible Placement Predicates 19 Grid CONSTRAINTS and tile CONSTRAINTS go hand in hand. The format for the former is that of a property list,1 the latter consists of lists of indicators only. The corresponding. values are retrieved when DEFTILE composes the PLACEMENT-OKAY-P function. The association is obvious, but suggests another subtlety of the grid-to-plane map-ping; that is, the row band corresponds to Y coordinates, the col band to X coordinates. This may cause momentary confusion in one who is used to seeing coordinates specified as, for instance, (row col) or (24 9) whereas, in plane coordinates, (X Y) or (9 24) is the usual order. 1Property lists are another type of tabular data structures, similar to a-lists, but consisting of alternating indicator/value pairs. For instance, (SIZE TEENY-WEENY COLOR YELLOW PATTERN POLKA-DOT) might be a property list for a certain bikini. There are built-in functions, GET, PUTPROP, and REMPROP for accessing, adding and removing properties. In most Lisp dialects, each symbol has a property list, and these functions apply only to symbols. In Symbolics-Lisp, however, property lists can also be disembodied, that is, not associated with a particular symbol, and these functions can operate on them directly. This permits the use of such hybrid data structures as property association lists (PAL for short,) which behave as both kinds of lists. For example: (DEFVAR *DIET-PAL* ' ((MILK FOOD-GROUP DAIRY SERVING-SIZE 8-0UNCES CALORIES 90) (TOAST FOOD-GROUP GRAINS SERVING-SIZE 1-SLICE CALORIES 70) (PEACH FOOD-GROUP FRUITS SERVING-SIZE 1-MEDIUM CALORIES 60))) (DEFUN GET-DIET-INFO (ITEM INDICATOR) (GET (ASSQ ITEM *DIET-PAL*) INDICATOR)) (GET-DIET-INFO 'MILK 'CALORIES) => 90 (GET-DIET-INFO 'PEACH 'FOOD-GROUP) => FRUITS |