1
0
mirror of synced 2026-05-01 14:06:47 +00:00
Files
Interlisp.medley/internal/test/Library/TEDIT/hand-aux/BIG-FOOTNOTE.TEDIT
2020-12-28 10:33:23 -08:00

12 lines
9.9 KiB
Plaintext
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
Description
1. using CLOS
Almost all of AGAST--story segments, goals, actions, etc.--is written using CLOS [Bobrow et al 87], an object oriented programming language built on Common Lisp [Steele et al 84].
Like other object oriented languages, CLOS has a hierarchy of inheritance, with leaf classes inheriting everything defined in classes along the path from the root to the leaf. Information storage is in slots. There are two types of slot inheritance in CLOS: class and instance. Class slots have their value inherited by all their subclasses; that is, the slot is defined in a superclass, and all subclasses access the same slot. Instance slots are passed down the hierarchy, with each instance getting its own copies of instance slots; thus each instance can have its own value for an inherited instance slot.
The class hierarchies deemed necessary for AGAST required the implementing of a third type of slot inheritance, the template slot. Template slots are inherited like instance slots, but at the leaf level they are turned into class slots so that instances all share the same slot value. For instance, the template slot NUM-OF-LEGS is defined in the class ANIMAL and is inherited by all subclasses. It is turned into a class slot in the leaf classes HUMAN and HORSE. All instances of HUMAN share the value of "2" for that slot, while all intances of HORSE share the value of "4."
Methods allow slots needing values to access other slots to determine or compute those values. For instance, each instance of a living thing has a slot containing instances of LEG. The number of LEGs is based on the value of the slot NUM-OF-LEGS of the class of the living thing. For EARTH-CREATUREs, the slot NUM-OF-LEGS is predefined; for ALIENs, the slot is a random number (with an upper limit, fortunately). If a type of alien is given an odd number of legs, the number is reduced by one and a tail is added on. Thus determining a slot's value is almost unrestricted.
In this report, "CLOS object" means a CLOS object (which can be either a class or an instance), "class" means the definition of the object, and "object" or "thing" means an instantiation of a CLOS object, such as Libby or her 44-magnum. The names of classes are capitalized. Methods are functions that specialize on the the types of their arguments, so that, for instance, the method DO-INJURE (which executes the action INJURE) does one thing with the actor being of class INTELLIGENCE and something else if the actor is of the more general class ANIMAL.
2. objects
An integral part of AGAST is the story world, a represention of the physical aspects of the story. Like story segments and goals, physical things are CLOS objects. The characteristics of things are determined by what CLOS classes they inherit from. The class OBJECT-TYPE contains characteristics that all things have, such as a place to store the thing`s location and how much damage it has taken, as well as ways of damaging or repairing it.
For instance, HUMANs inherit from the class INTELLIGENCE which gives them such things as useable hands and goals, and also from EARTH-CREATURE, which is a subclass of ANIMAL, which is a subclass of LIVING-THING [fig. 1], which is a subclass of OBJECT-TYPE, each of which contributes characteristics which are shared by all their subclasses. Horses are also EARTH-CREATUREs, but do not share intelligence. EARTH-CREATURE also inherits from FOOD, which means that they are edible (though usually after they are dead!).
((
FIELDS (
SIDESFLG T)
IDS 18 1 2 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
FONTS 1 (HELVETICA 6 BRR)
BORDERS 18
(2 0)
(2 0)
(2 0)
(2 0)
(2 0)
(2 0)
(2 0)
(2 0)
(2 0)
(2 0)
(2 0)
(2 0)
(2 0)
(2 0)
(2 0)
(2 0)
(2 0)
(2 0)
NODES (
(1 CLOSHORSE
(297 . 135) 1 1 NIL NIL (3 ))
(2 CLOSCAT
(293 . 125) 1 2 NIL NIL (3 ))
(3 CLOSPET
(245 . 130) 1 3 NIL (2 1 ) (11 ))
(4 CLOSMOUSE
(250 . 115) 1 4 NIL NIL (11 ))
(5 CLOSSNAKE
(249 . 105) 1 5 NIL NIL (11 ))
(6 CLOSGIANT-CENTIPEDE
(268 . 95) 1 6 NIL NIL (11 ))
(7 CLOSHUMAN
(252 . 85) 1 7 NIL NIL (11 ))
(8 CLOSVORPAL-BUNNY
(264 . 75) 1 8 NIL NIL (11 ))
(9 CLOSMONSTER
(215 . 60) 1 9 NIL NIL (12 ))
(10 CLOSSENTIENT
(215 . 40) 1 10 NIL NIL (12 ))
(11 CLOSEARTH-CREATURE
(174 . 105) 1 11 NIL (8 7 6 5 4 3 ) (16 ))
(12 CLOSALIEN
(154 . 50) 1 12 NIL (10 9 ) (16 ))
(13 CLOSPOMEGRANET
(163 . 25) 1 13 NIL NIL (17 ))
(14 CLOSSAPLING
(153 . 15) 1 14 NIL NIL (17 ))
(15 CLOSTREE
(148 . 5) 1 15 NIL NIL (17 ))
(16 CLOSANIMAL
(96 . 85) 1 16 NIL (12 11 ) (18 ))
(17 CLOSPLANT
(93 . 15) 1 17 NIL (15 14 13 ) (18 ))
(18 CLOSLIVING-THING
(25 . 70) 1 18 NIL (17 16 ) NIL)
))
0 0)
Figure 1: Class hierarchy under LIVING-THING
A 44-magnum, on the other hand, is a PROJECTILE [weapon], which inherits from WEAPON which inherits from OBJECT-TYPE. A 44-magnum is also a NON-LIVING-THING thing [fig. 2].
((
FIELDS (
SIDESFLG T)
IDS 25 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
FONTS 1 (HELVETICA 6 BRR)
BORDERS 25
(2 0)
(2 0)
(2 0)
(2 0)
(2 0)
(2 0)
(2 0)
(2 0)
(2 0)
(2 0)
(2 0)
(2 0)
(2 0)
(2 0)
(2 0)
(2 0)
(2 0)
(2 0)
(2 0)
(2 0)
(2 0)
(2 0)
(2 0)
(2 0)
(2 0)
NODES (
(1 CLOS44-MAGNUM
(194 . 155) 1 1 NIL NIL (10 ))
(2 CLOSBB-GUN
(185 . 145) 1 2 NIL NIL (10 ))
(3 CLOSEXCALIBUR
(117 . 225) 1 3 NIL NIL (25 ))
(4 CLOSTHORS-HAMMER
(126 . 215) 1 4 NIL NIL (25 ))
(5 CLOSKNIFE
(109 . 205) 1 5 NIL NIL (25 ))
(6 CLOSSWORD
(111 . 195) 1 6 NIL NIL (25 ))
(7 CLOSBRANCH
(113 . 185) 1 7 NIL NIL (25 ))
(8 CLOSPICK-AXE
(114 . 175) 1 8 NIL NIL (25 ))
(9 CLOSROCK
(108 . 165) 1 9 NIL NIL (25 ))
(10 CLOSHAND-GUN
(118 . 150) 1 10 NIL (2 1 ) (25 ))
(11 CLOSELECTRIC-PENCIL-SHARPENER
(146 . 135) 1 11 NIL NIL (25 ))
(12 CLOSHAM-SANDWICH
(126 . 125) 1 12 NIL NIL (25 ))
(13 CLOSCANDYBAR
(118 . 115) 1 13 NIL NIL (25 ))
(14 CLOSMASON-JAR
(119 . 105) 1 14 NIL NIL (25 ))
(15 CLOSBACKPACK
(117 . 95) 1 15 NIL NIL (25 ))
(16 CLOSBAZOOKA
(116 . 85) 1 16 NIL NIL (25 ))
(17 CLOSTELEPHONE-BOOK
(129 . 75) 1 17 NIL NIL (25 ))
(18 CLMAP
(107 . 65) 1 18 NIL NIL (25 ))
(19 CLOSMEDIKIT
(113 . 55) 1 19 NIL NIL (25 ))
(20 CAR
(106 . 45) 1 20 NIL NIL (25 ))
(21 CLOSCHEST-OF-DRAWERS
(131 . 35) 1 21 NIL NIL (25 ))
(22 CLOSBOULDER
(115 . 25) 1 22 NIL NIL (25 ))
(23 CLOSDOOR
(109 . 15) 1 23 NIL NIL (25 ))
(24 CLOSBED
(106 . 5) 1 24 NIL NIL (25 ))
(25 CLOSNON-LIVING-THING
(33 . 115) 1 25 NIL (24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 ) NIL)
))
0 0)
Figure 2: Class hierarchy under NON-LIVING-THING
Libby and her particular 44-magnum are instances of the CLOS objects HUMAN and 44-MAGNUM. Libby inherits values that all humans share (such as the fact that they have two arms and two legs), plus individual values for other slots (green eyes, her particular two legs and two arms; each body part is an instance another CLOS object).
(LIST ((PAGE NIL (PAPERSIZE Letter FOLIOINFO (ARABIC "- " " -") STARTINGPAGE# 1) (0 0 612 792) ((FOLIO NIL (PARALOOKS (QUAD CENTERED) CHARLOOKS (SUPERSCRIPT 0 INVISIBLE OFF SELECTPOINT OFF PROTECTED OFF SIZE 10 FAMILY MODERN OVERLINE OFF STRIKEOUT OFF UNDERLINE OFF EXPANSION REGULAR SLOPE REGULAR WEIGHT MEDIUM INVERTED OFF USERINFO NIL STYLE NIL) FORMATINFO (ARABIC "- " " -")) (162 36 288 36) NIL) (TEXT NIL NIL (108 72 432 648) NIL))) (PAGE NIL (PAPERSIZE Letter FOLIOINFO (ARABIC "- " " -")) (0 0 612 792) ((FOLIO NIL (PARALOOKS (QUAD CENTERED) CHARLOOKS (SUPERSCRIPT 0 INVISIBLE OFF SELECTPOINT OFF PROTECTED OFF SIZE 10 FAMILY MODERN OVERLINE OFF STRIKEOUT OFF UNDERLINE OFF EXPANSION REGULAR SLOPE REGULAR WEIGHT MEDIUM INVERTED OFF USERINFO NIL STYLE NIL) FORMATINFO (ARABIC "- " " -")) (162 36 288 36) NIL) (TEXT NIL NIL (108 72 432 648) NIL))) (PAGE NIL (PAPERSIZE Letter FOLIOINFO (ARABIC "- " " -")) (0 0 612 792) ((FOLIO NIL (PARALOOKS (QUAD CENTERED) CHARLOOKS (SUPERSCRIPT 0 INVISIBLE OFF SELECTPOINT OFF PROTECTED OFF SIZE 10 FAMILY MODERN OVERLINE OFF STRIKEOUT OFF UNDERLINE OFF EXPANSION REGULAR SLOPE REGULAR WEIGHT MEDIUM INVERTED OFF USERINFO NIL STYLE NIL) FORMATINFO (ARABIC "- " " -")) (162 36 288 36) NIL) (TEXT NIL NIL (108 72 432 648) NIL)))))8
 (FOOTNOTE T)8 (FOOTNOTE T)8 (FOOTNOTE T),
-
T,,
,GACHAGACHA
GACHA
?1(DEFAULTFONT 1 (GACHA 10) (GACHA 8) (TERMINAL 8))
GACHA ?1(DEFAULTFONT 1 (GACHA 10) (GACHA 8) (TERMINAL 8))
 
µhGC.
¿ÝGRAPHOBJ.GETFNGACHA
,¯:GRAPHOBJ.GETFNGACHA
1O<2zº