1 Medley for the Novice, Release 2.0 1 Medley for the Novice, Release 2.0 17. THE INSPECTOR 1 17. THE INSPECTOR 1 "17"17. THE INSPECTOR 6 The Inspector(INSPECTOR NIL Inspector NIL ("17") 1) is a window-oriented tool designed to examine data structures. Because Medley is such a powerful programming environment, many types of data structures would be difficult to see in any other way. Calling the Inspector(INSPECTOR NIL Inspector NIL ("17") 1 SUBNAME CALLING SUBTEXT calling) 1 Take as an example an object defined through a sequence of pointers (i.e., a bitmap on the property list of a window on the property list of an atom inaprogram.) To inspect an object named NAME, type: (INSPECT 'NAME) If NAME has many possible interpretations, an option menu will appear. For example, in Interlisp-D, a litatom can refer to both an atom and a function. For example, if NAME was a record, had a function definition, and had properties on its property list, then the menu would appear as in Figure 17-1. `\???;;;.0az=kg}۝z=k}[=k};[>o}۽7ۻ>~.;wۻ??   <>  B!   !   ! >   B  <      ?     H ?G  @@  @     ?     > A @ <   A >     x``!$H`!$H(` !QO` !PG|` !2$` !2$`q>`````pqǏ>`!$H"`!$H"`!QO` !PG|`@!2$`!2$ `q>```aaqǏ>at!$H"a!$Ha!QOa!PG|a!2$at!2$"aqaaa`` ffg```c !>xb!" DDbG!" DDc@⊐xB'`````````````````````````````m|}xp~{=~v{u~]}{u~m}~m}ͭϽ~u}ݿy~݀}x~~```` qǏ>``!$H`!$H(` !QO` !PG|` !2$` !2$`q>`````pqǏ>`!$H"`!$H"`!QO` !PG|`@!2$`!2$ `q>```aa8pqv8atm۷&nam۷&naޮ{VnaޯwVnaVnatVna;qvaaa`` ff:m|}xp~{=~v{u~]}{u~m}~m}ͭϽ~u}ݿy~݀}x~~```` qǏ>``!$H`!$H(` !QO` !PG|` !2$` !2$`q>`````pqǏ>`!$H"`!$H"`!QO` !PG|`@!2$`!2$ `q>```aaqG<BOatFH"HaFH"HaEH"POa%K"|QHaȐ"QHat$Ȑ"!Haq$G<!㏀aaa`` Figure 17-3. Steps Involved in Changing Value in Right Column of Inspector Window Inspector Example 1 This example will use ideas discussed in Chapter 21. An example, ANlMALGRAPH, is created in that section. You do not need to know the details of how it was created, but the structure is examined in this chapter. If you type (INSPECT ANIMAL.GRAPH) and then choose the Inspect option from the menu, a display appears as shown in Figure 17-4. ANlMAL.GRAPH is being inspected as a list. Note the numbers in the left column of the inspectorwindow. ffp߀ݿݿݿ~}oݿݿݿ~oݿݿ<{ݿݿ{~Wݿݿ{~g~{]]0{oݿ~݁݁~000 @0@@" #"8pq"8#0@"P!2H! 2!0@"P!2H! 2!0@ > *x! *0@"T*D!B @*0@"a&D!" &a0@"a&D! &a0@"t#"8xq@"8#0@0 @00000@0@0 @0@@0@0@0@000000000P0P00000000000`000 P0 P000 00 000000000P0P00000000000000P0P0000000000000 0 P0@P0@0000000000000P0P00000000000000P0P00000000000A0 0B`0BP0BP0C 00B 00000000@00B0@P0@P0@00@00000000A0 0B 0@@P0@P0A00B00000000 Figure 17-4. Inspector Window For ANIMAL.GRAPH, Inspected as List If you choose the "As A Record" option, and choose "GRAPH" from the menu that appears, the inspector window looks like Figure 17-5. Note the fieldnames in the left column of the inspector window. ffp߀ݿݿݿ~}oݿݿݿ~oݿݿnj0<{ݿݿݝve{~Wݿݿ㽃~o{~g~{]]=~o{oݝvoݿ~݁݁Ǐ0~xÀ@"D$@@"D$@@ˆD#@rOx@G@@@$H@@@$H@|8B#p@@"D$HH@@"D$HH@@ˆ@x@@rO@"D@@GDdH>D@$HDdH"D@$H8#"x@|8珐p@@"BH@@"BH@@ˆǂx@@rO"D@@G>D@$HBB"D@$H8CB"x@|8珜xȀ@"B"D$ @"B"D$ @ˆǂ"xNJ@rO"P @G"HD @$HBB"D$ @$H8CBD$||q㈄"8 @"@H2D @"@H2D @ˆxP*@@rO@P*\@G@0H&D`@$H@0H&D`@$H@q"8 |xϐD @"Dd @"Dd @ˆDT@rODT@GDL`@$HDL`@$HxD |>D@"( d@"( d@ˆ( D@"($H d@"($H d@ˆ(H|@"lH @@"lH @@ˆTH@|Ǐ>|@H@@@H@@@x@@@@@@H@@@O||Ǐ>@pH @H @O <@ H @H @H @Ǐ |p@@"8|p "8# < #"8"2D @! 2! "P!2"2D @! 2!"P!2ˆ*Dx *" *rO*D@@ " @*>|B"T*G&D @! &aB"a&$H&D @! &aB"a&$H"8@p @"8# <t#"8 @@ Figure 17-5. Inspector Window for ANlMAL.GRAPH, Inspected as Instance of GRAPH Record The remaining examples will use ANlMAL.GRAPH inspected as a list. When the first item in the Inspector window is chosen with the leff mouse button, the Inspector window looks like Figure 17-6. ffp߀ݿݿݿ~}oݿݿݿ~oݿݿ<{ݿݿ{~Wݿݿ{~g~{]]0{oݿ~݁݁~000߿0@x8w?w0{0@~0@~}^^0@~^>޽^0@~w0@~w0{p?p00߿00000@0@0 @0@@0@0@0@000000000P0P00000000000`000 P0 P000 00 000000000P0P00000000000000P0P0000000000000 0 P0@P0@0000000000000P0P00000000000000P0P00000000000A0 0B`0BP0BP0C 00B 00000000@00B0@P0@P0@00@00000000A0 0B 0@@P0@P0A00B00000000 Figure 17-6. Inspector Window for ANlMAL.GRAPH With First Element Selected When you use the middle mouse button to inspect the selected list element, the display looks like Figure 17-7. ff=p߀ݿݿݿ~}oݿݿݿ~oݿݿ<{ݿݿ{~Wݿݿ{~g~{]]0{oݿ~݁݁~000߿0@x8w?w0{0@~0@~}^^0@~^>޽^0@~w0@~w0{p?p00߿00000@0@0 @0@@0@0@0@000000000P0P00000000`t�~@?;ݿoyݻ{~v{ݿxa뻾~v}ݿ }>۷}ݿ }ۻ۷v}?>ݿ}ogv}]= }oݿv{~x ~}Ǿ?~݁~~w```  !Èp@``!H0 "@`AHP "@` A P@P` A@"P@P>` AHȀ"0@0` AH"0@0`!È|q|` ` `` p!Ǐp@`! H0"@`A HP"@`A P@P` A@P@P>`@AȀ0@0`AH 0@0`!O|q>|` ` `` p 8p  `!ADB B@`AA(DB B@`pAA8B B`A!DB B`ADB B`A!DB B`p !>8p>` ```0!À|p `P!$@B B`PA$@( B B`A$pB B`A%B B`A$@B B`A$@ B B`!À> p>` ``` @@ B!@À| A@` Cb@$@ !@`@b@$@ B@`@@$ C@P`@J"@%" B @P`@ʕ>@$@> B @0`@J"@$@"B @0`p B$H"|À" |ǘ` @ ` @@`A`  B`p @G@@<B8pB` AFB@"B$BDBB`@FB@"B$ADBC `@EB@@"ABB `@%B"@B"@DA B`@>@B"B$A @B`@$"@B"B$A@B`p B$G"|<B|` @` `@`B@@P0@00@00000000A0 0B 0@@P0@P0A00B00000000 Figure 17-7. Inspector Window for ANlMAL.GRAPH and for First Element of ANIMAL.GRAPH How you can see that six items make up the list, and you can further choose to inspect one of these items. Notice that this is also inspected as a list. As usual, it could also have been inspected as a record. Select item 5 - MAMMAL DOG CAT - with the left mouse button. Press the middle mouse button. Choose "Inspect" to inspect your choice as a list. The Inspector now displays the values of the structure that makes up MAMMAL DOG CAT. (See Figure 17-8.) ff3?~ ?03{}׮ׯ}׮ׯ~0[w~[?~}v{~ۻ}v? w}?0000 @0@B!@À| 0Cb@$@ 0@b@$@0@@$0@J"@%"0@ʕ>@$@>0@J"@$@"0B$H"|À" 0@ 0 @000 0@ 0AHa0Ȁ@0 H!@0@G!@0@!@0H!@0C0@0 0000000P0P00000000000`000 P0 P000 00 000000000P0P00000000000c000#0" 0 0" 0!000000A0 0 B0 C0@B 0@B 0B 000000 0CÇ@0B$H"( @0$H"( 0$H ( 0$K D 0$H"| 0$H"D 0CÇD @0@@0 000 @0@"@D0B BI"@! 0AH0B| q0@00 0000@H 0F͊ 0BF͊ 0@QEJ 0@R%J 0@SJ 0@R%J 0$H>000000A0 0B 0@@P0@P0A00B00000000 Figure 17-8. Inspector Window for Element S From Figure 17.7 That Begins ((MAMMAL DOG CAT). (LIST ((PAGE NIL (PAPERSIZE Letter FOLIOINFO (ARABIC "17-" "") STARTINGPAGE# 1) (0 0 612 792) ((FOLIO NIL (PARALOOKS (QUAD RIGHT) CHARLOOKS (SUPERSCRIPT 0 INVISIBLE OFF SELECTPOINT OFF PROTECTED OFF SIZE 10 FAMILY HELVETICA OVERLINE OFF STRIKEOUT OFF UNDERLINE OFF EXPANSION REGULAR SLOPE REGULAR WEIGHT MEDIUM INVERTED OFF USERINFO NIL STYLE NIL) FORMATINFO (ARABIC "17-" "")) (270 15 288 36) NIL) (HEADING NIL (HEADINGTYPE FOOTINGR) (54 27 558 36) NIL) (TEXT NIL NIL (54 54 504 690) NIL))) (PAGE NIL (PAPERSIZE Letter FOLIOINFO (ARABIC "17-" "")) (0 0 612 792) ((FOLIO NIL (PARALOOKS (QUAD LEFT) CHARLOOKS (SUPERSCRIPT 0 INVISIBLE OFF SELECTPOINT OFF PROTECTED OFF SIZE 10 FAMILY HELVETICA OVERLINE OFF STRIKEOUT OFF UNDERLINE OFF EXPANSION REGULAR SLOPE REGULAR WEIGHT MEDIUM INVERTED OFF USERINFO NIL STYLE NIL) FORMATINFO (ARABIC "17-" "")) (54 15 288 36) NIL) (HEADING NIL (HEADINGTYPE FOOTINGV) (54 27 558 36) NIL) (HEADING NIL (HEADINGTYPE VERSOHEAD) (54 762 558 36) NIL) (TEXT NIL NIL (54 54 504 684) NIL))) (PAGE NIL (PAPERSIZE Letter FOLIOINFO (ARABIC "17-" "")) (0 0 612 792) ((FOLIO NIL (PARALOOKS (QUAD RIGHT) CHARLOOKS (SUPERSCRIPT 0 INVISIBLE OFF SELECTPOINT OFF PROTECTED OFF SIZE 10 FAMILY HELVETICA OVERLINE OFF STRIKEOUT OFF UNDERLINE OFF EXPANSION REGULAR SLOPE REGULAR WEIGHT MEDIUM INVERTED OFF USERINFO NIL STYLE NIL) FORMATINFO (ARABIC "17-" "")) (270 15 288 36) NIL) (HEADING NIL (HEADINGTYPE FOOTINGR) (54 27 558 36) NIL) (HEADING NIL (HEADINGTYPE RECTOHEAD) (54 762 558 36) NIL) (TEXT NIL NIL (54 54 504 690) NIL))))),,HH,HH,HH2llZ2HHZ2HH Z2HHZ2HZZ,HH,HH -T-T,25F PAGEHEADING VERSOHEADF PAGEHEADING RECTOHEADE PAGEHEADINGFOOTINGVE PAGEHEADINGFOOTINGR,HH, TITAN CLASSIC HELVETICAMODERN HELVETICACLASSIC  HELVETICA MODERN  TIMESROMAN  HRULE.GETFNMODERN " HRULE.GETFNCLASSIC # HRULE.GETFNCLASSIC  HRULE.GETFNCLASSIC  IM.CHAP.GETFN HELVETICA HRULE.GETFNMODERN   &IM.INDEX.GETFN  FIM.INDEX.GETFN  HRULE.GETFNCLASSIC     < BMOBJ.GETFN3 TIMESROMAN  -  [ + +  .  BMOBJ.GETFN3CLASSIC 1  BIM.INDEX.GETFN  HRULE.GETFNCLASSIC  U  Y$9K BMOBJ.GETFN3CLASSIC   BMOBJ.GETFN3CLASSIC  BMOBJ.GETFN3CLASSIC S   HRULE.GETFNCLASSIC A  ] [ BMOBJ.GETFN3CLASSIC " 4&p BMOBJ.GETFN3CLASSIC "    BMOBJ.GETFN3CLASSIC " o BMOBJ.GETFN3CLASSIC "   BMOBJ.GETFN3CLASSIC I z