UBC Theses and Dissertations

UBC Theses Logo

UBC Theses and Dissertations

Antics : a system for animating LISP programs Dionne, Mark Stephen 1975

Your browser doesn't seem to have a PDF viewer, please download the PDF to view this item.

Item Metadata

Download

Media
831-UBC_1975_A6_7 D05.pdf [ 6.35MB ]
Metadata
JSON: 831-1.0051764.json
JSON-LD: 831-1.0051764-ld.json
RDF/XML (Pretty): 831-1.0051764-rdf.xml
RDF/JSON: 831-1.0051764-rdf.json
Turtle: 831-1.0051764-turtle.txt
N-Triples: 831-1.0051764-rdf-ntriples.txt
Original Record: 831-1.0051764-source.json
Full Text
831-1.0051764-fulltext.txt
Citation
831-1.0051764.ris

Full Text

ANTICS - A System f o r Animating LISP Programs  by Mark Stephen Dionne B. Sc. (with honor), Michigan State U n i v e r s i t y , 1972  A THESIS SUBMITTED IN PARTIAL FULFILLMENT OF THE REQUIREMENTS FOR THE DEGREE OF MASTER OF SCIENCE  in THE DEPARTMENT OF COMPUTER SCIENCE  We accept t h i s t h e s i s as conforming to the r e q u i r e d  standard.  THE UNIVERSITY OF BRITISH COLUMBIA October, 1975 (c) Mark Stephen Dionne, 1975  In  presenting  an  advanced  the I  Library  further  for  degree shall  agree  scholarly  by  his  of  this  thesis  in  at  University  the  make  that  it  thesis  purposes  for  freely  may  be  It  financial  for  of  University  British  2075 Wesbrook P l a c e Vancouver, Canada V6T 1W5  October 27, 1975  of  Columbia,  British  by  gain  Columbia  for  the  understood  Computer Science of  of  extensive  granted  is  fulfilment  available  permission.  Department  bate  partial  permission  representatives.  written  The  this  shall  Head  be  requirements  reference copying  that  not  the  of  agree  and  of my  I  this  or  allowed  without  that  study. thesis  Department  copying  for  or  publication my  ABSTRACT  An  animated  film  is  an  excellent  complex ideas i n computer s c i e n c e . which  medium f o r conveying  A system has been  developed  produces animated f i l m s , f i l m s t r i p s , o r s l i d e s  the e x e c u t i o n o f LISP programs.  The design  of  and  this  system  is  discussed  and  depicting  implementation  i t i s compared to e x i s t i n g  systems. The system, named ANTICS, may simple  commands,  may be "backed changed.  minute  up * 1  which  details  explicitly  used  by  entering  and produces r e a l - t i m e a n i m a t i o n .  Advanced  available  be  interactively  and  atomic  very  The system  values  may  be  commands and a s e t o f g r a p h i c s p r i m i t i v e s are permit  of  the  an i n s t r u c t o r o r film-maker to c o n t r o l animation  provided by the system.  and  to  add  features  not  ANTICS may t h e r e f o r e be used  as an i n t e r a c t i v e e d u c a t i o n a l t o o l o r as an animation system. ANTICS  is  very  showing the o p e r a t i o n produced  for  a  economical of  the  use.  recursive  t o t a l c o s t of $12.00.  part of the t h e s i s .  A three minute  function The f i l m  The system i s dependent  Adage Graphics Terminal hardware, on  to  MEMBER  film was  i s i n c l u d e d as  on IBM 370/168  and  but t h e d e s i g n , which i s based  the o r g a n i z a t i o n of the LISP EVAL f u n c t i o n , could be used on  other systems.  iii  TABLE OF CONTENTS  CHAPTER I - PROGRAM ANIMATION  1  1.1 I n t r o d u c t i o n  1  1.2 M o t i v a t i o n  1  •1.3 Relevant L i t e r a t u r e  3  1.4 Types o f Animation  4  1.5 Animation  5  Methods  1.5.1 Key frame animation  5  1.5.2 Simple  6  animation  CHAPTER I I - SYSTEM DESIGN 2. 1 D i s p l a y Design 2.1.1  S-expressions  2.1.2 E v a l u a t i o n  8 8 8 10  2.2 Single-frame v s . Real-time Animation  13  2.3 S c r i p t Design  15  2.4 Graphics P r i m i t i v e s  16  2.5 Human F a c t o r s A f f e c t i n g Design  17  CHAPTER I I I - IMPLEMENTATION 3.1 System O r g a n i z a t i o n  21 . 21  3.1.1 The Adage Graphics Terminal  21  3.1.2 The GRAPH s u p e r v i s o r program  22  3.1.3 LISPBASIC  22  3.1.4 LISP/MTS  23  3.2 D i s p l a y F i l e O r g a n i z a t i o n  23  3.3 Methods Used i n the Program  31  3.4 Cost and E x e c u t i o n Time  32  CHAPTER IV - CONCLUSIONS  33  iv  4.1 Comparison With E x i s t i n g Systems  33  4.2 P o s s i b l e Improvements t o ANTICS  33  4.3 Summary  34  BIBLIOGRAPHY  35  APPENDIX A - ANTICS USER'S GUIDE  39  1. The ANTICS S c r i p t  39  2. How t o Run ANTICS  41  3. Using the System I n t e r a c t i v e l y  42  4. The ANTICS EVAL F u n c t i o n  43  5. A d d i t i o n a l Commands  45  6. Graphics Language  45  7. I n t e r f a c i n g with GLISP  49  8. Producing F i l m s  50  9. Commands  54  10. Graphics P r i m i t i v e s  60  11. U s e f u l ANTICS V a r i a b l e s  62  Index to ANTICS User's Guide  68  APPENDIX B - SAMPLE ANTICS SCRIPTS  69  APPENDIX C - ANTICS PROGRAM LISTING  73  V  LIST OF FIGURES  1 • An Example of the D i s p l a y of S-expressions  9  2 * Snapshot o f EVAL Animation  12  3 • Display F i l e Organization  26  4 • Dimensions of an EVAL Box  65  5 • Dimensions of a CONS-cell  66  vi  ACKNOWLEDGEMENT  I  would  Mackworth  like  to  express  f o r suggesting  this  my  appreciation  thesis  and  to  thank  Dr. Alan  for h i s helpful  s u g g e s t i o n s f o r making the system more v e r s a t i l e . like  to  I would  also  Dr. Barry P o l l a c k and Dr. R i c h a r d Rosenberg f o r  t h e i r suggestions f o r improving  this  thesis.  1  CHAPTER I - PROGRAM ANIMATION  INTRODUCTION Animated becoming  films  and  displays  have  shown  potential  u s e f u l and p r a c t i c a l t e a c h i n g a i d s i n computer  education.  Animation can be used to  illustrate  of  science  actions  which  normally cannot be seen, and which are d i f f i c u l t t o express on a blackboard  because  of  their  complexity  or  c o n d i t i o n s o f t e n occur while teaching computer A system named ANTICS programs  written  has  been  i n LISP £ 1 6 ] ,  dynamics.  These  science.  produced  which  animates  The system i s designed f o r use  by an i n s t r u c t o r i n a programming course, a l l o w i n g her  to  films  the LISP  which  will  demonstrate  various  features  language and o f a l g o r i t h m s programmed i n LISP. may of  of  The  make  instructor  c o n t r o l the p a r t s o f LISP which a r e animated, and the amount d e t a i l which i s shown.  economical  enough  to  Also,  be  used  the as  system an  i s simple  on-line  and  interactive  instructional aid.  I2.2 MOTIVATION Teaching involved will  beginning  graphic  verify  organization  tools  this.  computer —  Flowcharts,  of  almost  always  has  a guick l o o k through many textbooks  diagrams,' parse  graphic representations  science  data  trees,  certain  structures,  hardware algorithms  system  schematics and each  have  an  2  important  place i n  computer  science  the  language  of  computer  is  dynamic  Many  1  concepts, such as the s t a c k , the l i n k e d  and the a r r a y have an i m p l i c i t g r a p h i c which  science.  invariably  concepts  do  taught not  language  of  i n beginning c o u r s e s . have  well  list,  their  own  Other more  established  graphic  r e p r e s e n t a t i o n s , s i n c e t h e i r a c t i o n s a r e not easy t o convey with fixed  images.  Examples  of  these  are  recursion, iteration,  b i n d i n g , and a l g o r i t h m s such as s e a r c h i n g , s o r t i n g , and p a r s i n g . The motive f o r animating computer programs new . g r a p h i c  expressions  been  illustrated  [10, p. 313].) A v i s u a l greatly  enhance  the  which are d i f f i c u l t static  to  provide  f o r complex dynamic processes i n t h e  f i e l d of computer s c i e n c e . have  is  (Complex i d e a s  i n several display  of  in  physics  computer dynamic  already  produced  films  processes  should  s t u d e n t s a p p r e c i a t i o n of complex systems 1  t o a p p r e c i a t e when e x p l a i n e d  by  words  and  diagrams.  An  excellent  "hands on" helpful  by  appreciation  experimentation. the  2  of  This  a  system can be gained by  principle  was  found  very  i n v e s t i g a t o r while l e a r n i n g LISP: a system £ 9 ]  was a v a i l a b l e which would step through  programs,  restart,  T h i s type o f environment  change  values,  and  so on.  back  up  and  f o r c e s the student to t h i n k and a c t about what i s happening, and can q u i c k l y l e a d her to a b a s i c and c o n f i d e n t a p p r e c i a t i o n of system.  a  By making the animation system i n t e r a c t i v e , the student  l i t i s i n t e r e s t i n g t o note t h a t the o p e r a t i o n of hardware i s o f t e n represented g r a p h i c a l l y by means o f an o s c i l l o s c o p e . * T h i s i s the m o t i v a t i o n behind LOGO, a simple programming language which teaches mathematical and 'programming s k i l l s by being "played with" by c h i l d r e n [ 8 ] .  3  c o u l d e x p l o r e the LISP world v i s u a l l y and a t her own The  programming language LISP i s g u i t e d i f f e r e n t  programming languages. which  pace.  are  unigue  programmer may l e a r n LISP.  S-expressions to  LISP,  and  a  and  are  relatively  f e e l t h a t she i s a beginner  Because  EVAL  from most  when  concepts  experienced  she  tries  to  i t depends on these a b s t r a c t concepts, LISP  was s e l e c t e d as the language t o be animated.  jN 3 RELEVANT LITERATURE Although  computer  animation has been f a i r l y popular f o r a  number of years, few attempts have been made to produce animated computer  science f i l m s .  computer computer  animated  Until recently,  film  science [ 1 5 ] .  has  only  one  significant  been produced which i s r e l a t e d to  (This f i l m  was  produced  by  a  system  which c o s t approximately $600 per minute of f i l m [14].) Baecker  and h i s s t u d e n t s have done work i n t h i s area which  Baecker has a p t l y named "program have been produced by them. written  in  a  subset  c o n v e n t i o n s determines evaluation  of  of  LOGO  how  the  variables  parameter s e t t i n g s may  One  illustration" [2]. system  animates  used  to  any  execution  statements  of  fixed  w i l l be d i s p l a y e d v i s u a l l y .  a  program  A  be added to the  animate  systems  £2, p. 160].  program  to  t i m i n g and s p a t i a l p o s i t i o n i n g of the animation. been  Two  simple LOGO program  s e t of and  Optional  tailor  the  The system has  which r e v e r s e s a  c h a r a c t e r s t r i n g , demonstrating f e a t u r e s of the LOGO language as w e l l as the concept of r e c u r s i o n . program  to  be  animated  T h i s system a l l o w s  without adding s p e c i a l  any  commands.  system i s too expensive f o r production work, however.  LOGO The  4  The second system animates programs w r i t t e n i n a subset PL/1  [ 2 , p. 161].  of  Psuedo-comments, i n t e r s p e r s e d with the PL/1  source code, c a l l s p e c i a l f u n c t i o n s which produce the a n i m a t i o n . Producing a f i l m programmer  with t h i s system  may  take  several  hours  of  e f f o r t s i n c e the pseudo-comments must be w r i t t e n f o r  each program t o be animated.  However, more d e t a i l e d c o n t r o l  of  the  animation i s p o s s i b l e than i n the LOGO system.  T h i s system  has  been  a  used  algorithm;  to  the  without making  produce  a  film  illustrating  f i l m f o l l o w e d the e x e c u t i o n of the PL/1 r e f e r e n c e to the PL/1 language.  The PL/1  sorting program system  can produce f i l m c l i p s f o r $100 t o $200 per minute. Both a computer Section  of these systems produce key frames which are used by animation language to produce the f i n a l  has  table  algorithms  produced computer  algorithms  [13].  animated f i l m s  His  system  the  illustrating  applies  various  t o examples which are too l a r g e t o be managed e a s i l y  by hand, thus g i v i n g s t u d e n t s an a p p r e c i a t i o n when  (See  1.5.1.) N e i t h e r system can be used i n t e r a c t i v e l y .  Hopgood hash  film.  applied  t o n o n - t r i v i a l problems.  advantage  of  certain  for  the  methods  T h i s i s claimed to show  algorithms  more  clearly  than  mathematical a n a l y s i s or simple examples.  Vj.4 TYPES OF ANIMATION Four  major areas i n computer  from animation.  s c i e n c e are l i k e l y t o b e n e f i t  The methods developed are l i k e l y t o d i f f e r , and  when "program a n i m a t i o n " i s mentioned, a l s o be s p e c i f i e d .  The areas a r e :  the  exact  type  should  5 1. Animating  algorithms,  such  as  sorting,  parsing,  or  searching. 2. Animating programming language f e a t u r e s , such as "DO" i n FORTRAN or "COND" i n LISP., 3..Animating data  hardware  between  operation.  Animating  movement  of  r e g i s t e r s , a r i t h m e t i c u n i t s , memory and  channels. H. Animating concepts i n computer s c i e n c e , such as  control  s t r u c t u r e s and data s t r u c t u r e s .  ANIMATION METHODS  Ke_y Frame Animation Hand animation and computer animation both have made use o f the  key  frame animation technigue.  f o r every "key" frame o f the skilled"  artists  (or  a  An image i s f i r s t  finished  movie,  computer)  and  produce  then  "less  intermediate  " i n t e r p o l a t e d " frames, r e s u l t i n g i n the smooth movement f i g u r e s from one key frame to the next.  produced  of t h e  In t h e case of computer  key frame animation systems, the key frames c o u l d be produced by an  artist  using  a  data  tablet,  or by another program.  computer uses an a l g o r i t h m which matches l i n e successive The  line  lengthened  key  frames  segments or  of  shortened  segments  The  i n two  and  then produces i n t e r m e d i a t e frames.  the  first  gradually  key  frame  are  moved  and  u n t i l they are transformed  i n t o the matching l i n e segments i n the second  frame.  6  Key frame animation i s very s u i t a b l e where  The key frames may  have  films,  different  numbers  l i n e s and are u s u a l l y not drawn to exact s p e c i f i c a t i o n s ,  so a g e n e r a l i z e d r u l e i s necessary t o produce i n every case.  than  adeguate  A generalized rule usually w i l l  and approximations, however, and  in  artistic  there i s no need f o r p r e c i s e c o n t r o l of the i n t e r p o l a t i o n  between key frames. of  for  a special-purpose rule.  may  make  animation  assumptions  take more computation  Key frame animation may  producing computer s c i e n c e f i l m s , as Baecker  has  and  time  be  useful  shown  £2]#  but i t i s not the o n l y p o s s i b l e method.  1.5.2  Simple Simple  system  animation  to  produce  interactive animated  graphics  scale,  vectors.  relies  are  The  Hany  graphics  rotate  and  tools to  produce  systems  change  developed  provide  means  to  the i n t e n s i t y of s e t s of movement  and  The d e t a i l s of producing animation i n  are more i n v o l v e d than i n key and  for  a sequence of  These f a c i l i t i e s can be used t o produce  considerations  frame  animation:  d i s p l a y f i l e o r g a n i z a t i o n may  and complex motions of a r t i s t i c the  the f a c i l i t i e s of a g r a p h i c s  extended  animation e f f e c t s .  t h i s way  on  animation.  displays.  displace,  other  Animation  f i g u r e s may  be  timing  be d i f f i c u l t ,  impossible.  On  other hand, s i n c e most of the d e t a i l e d animating i s done at  high speeds by the feasible  to  A frame can initiated.  display  produce be  set  While  processor,  real-time " l i v e " up the  by  the  display  main  it  is  generally  more  animation by t h i s method. computer  processor  is  and  movement  producing  the  7  movement the main computer can be d i s p l a y change.  working  on  the  next  major  8  CHAPTER I I - SYSTEM DESIGN  2^1 DISPLAY DESIGN The  o v e r a l l purpose o f the ANTICS system  knowledge  of  programmer.  the There  basic  of  of  a r e two fundamental  foundation of LISP: the operation  operation  EVAL.  structure  of  LISP  i s t o impart some to  a  beginning  concepts which form the S-expressions,  and  the  The design o f ANTICS i s centered on these  two concepts.  S-exjaressions Although S-expressions o c c a s i o n a l l y a r e changed d u r i n g execution  of  a  typical  LISP  program, they g e n e r a l l y s p e c i f y  " s t r u c t u r e " i n some sense, and the f i r s t i s understand  order  to  have  case o f c i r c u l a r  It i s  a thorough knowledge o f LISP, e s p e c i a l l y i n the lists,  or as CONS-cells  display.  structures.  how S-expressions map i n t o CONS-cells i n  ANTICS  provides  d i s p l a y i n g a r b i t r a r y S-expressions form  t h i n g a student must do  S-expressions as s t a t i c data  important t o understand  the  either  the in  capability  of  "prettyprinted"  3  and p o i n t e r s .  F i g u r e 1 shows a CONS-cell  (The s c r i p t which produced  this display i s included i n  Appendix B.)  Prettyprinting i s a style o f p r i n t i n g LISP f u n c t i o n s which makes them easy t o read. A l l of the LISP examples i n t h i s t h e s i s are i n p r e t t y p r i n t e d form. 3  F i g u r e 1 - An Example of the D i s p l a y of S-expressions (actual size)  10  Since S-expressions are b a s i c a l l y s t a t i c , i s not p a r t i c u l a r l y a p p l i c a b l e to them. of  S-expressions  examples, and  A  dynamic  solid  may  be  obtained  by  this i s  the  approach  taken  understanding  examining in  animation  a number of  the  design  of  EVAL i s a complex, dynamic process.  It  ANTICS.  Zj.ls.2 E v a l u a t i o n The  operation  of  c o n s i s t s of a p r e c i s e l y ordered sequence of r e c u r s i v e o p e r a t i o n s on S-expressions, c o o r d i n a t e d with the b i n d i n g and variables  on  a  stack  or  a-list.  It  is  unbinding  p o s s i b l e t o be an  adequate LISP programmer without knowing e x p l i c i t l y about and  the  beginning  existence.  student  does  not  various  need  EVAL,  to know about i t s  On the other hand, the student who  as " j u s t another programming language"  of  i s learning  LISP  i s r e a l l y being shown the  a s p e c t s of EVAL, and should a p p r e c i a t e the i d e a of EVAL  when i t i s presented. ANTICS operation has any  bases of  its  the  o p e r a t i o n , by details  of  various  EVAL  facets  displaying the  itself.  the  them.  at  functions  on  the  ANTICS*  animation  simply  in  a  suitable  fashion.  into The  design have centered on s e l e c t i n g the parts of suitable  graphic  representations  Not every step i n the EVAL process has been animated;  fetching  example.  LISP  of EVAL as they are brought  them  EVAL to d i s p l a y and d e v i s i n g for  of  EVAL, though i t does not presume t h a t the student  knowledge of  reflects  animation  of  the  LAMBDA-expression  Other f a c e t s of EVAL may  has been omitted, f o r  be i n c l u d e d i n the  animation  the d i s c r e t i o n of the user, such as the d i s p l a y of v a r i a b l e s .  11  the s t a c k , and "EVLIS"* v a l u e s . The  b a s i c animation  proceeds as f o l l o w s  (refer  to  Figure  2): 1. The  form  which  i s being  d i s p l a y s c r e e n and, displayed  evaluated i s p r i n t e d on t h e  a f t e r a short i n t e r v a l , a  box i s  c o n t a i n i n g t h e word "EVAL", i n d i c a t i n g t h a t  the form has been sent t o EVAL. 2. I f the form c o n t a i n s parameters which must be e v a l u a t e d , then t h e i r e v a l u a t i o n i s animated to the r i g h t of the present d i s p l a y and the r e t u r n values are moved i n t o a column  below  the present  "EVAL"  box. A f t e r  "EVLIS" values have a l l been r e t u r n e d , t h e i r to  the dummy  variables  of  these  bindings  t h e LAMBDA-expressions  o p t i o n a l l y a r e d i s p l a y e d and the  o l d values  dummy v a r i a b l e s a r e placed on t h e s t a c k .  of the  whenever the  center of a c t i v i t y moves from the EVAL d i s p l a y t o some other the  part  of the s c r e e n , such as t h e s t a c k d i s p l a y ,  viewer's  "follower"  to  attention the new  i s directed area  by  moving  a  o f the screen.  The  f o l l o w e r i s simply a s t a r o r other simple f i g u r e  which  moves to the p e r i p h e r a l d i s p l a y area a t a  which  i s f o l l o w e d e a s i l y by the viewer's 3. I f t h e f u n c t i o n system  5  being  evaluated  rate  vision. i s p a r t o f the LISP  the returned value i s d i s p l a y e d a f t e r removing  the o r i g i n a l form from t h e s c r e e n .  Ifa  user-defined  *EVLIS r e f e r s to t h e f u n c t i o n that e v a l u a t e s arguments t o LISP f u n c t i o n s . I t i s part o f EVAL [ 1 6 ] . S  A  SUBS, a f u n c t i o n w r i t t e n i n assembly language.  12  I I  I I  I— I 1  cn M  1 z :d i  *~•  1 r —x-  l  cr  §1  I  II  I  t—  U7  IK  II  II u  1/3  I  I I  3, II—  in —  W7  '  *"} 8ft J  DC  -  5^  VI  — ^ S2 f a a  ^ -  >-i  3E. Ul  21  Z  X.  o  i—  42g  _ — u  -55 x  —•  5s5  3-* a  2  cr  in  i £-  Z  tc UJ  z  —  x tc  UJ CD  a  K U  d 5 g  ~Q  »-i  in  •—i —•  K  J ^  13  _i  f=  " w  ui O  w  r ~  i  uiuj  C C  is z 5  Ui  Z  UJ  Ul  a  to  kxl _l  Figure  2 - S n a p s h o t o f EVAL (8/10  actual  size)  Animation  I  II  I—  II La  z  in —•  13  function  is  being  evaluated,  the e x p r e s s i o n s which  c o n s t i t u t e the body of i t s d e f i n i t i o n are e v a l u a t e d i n turn.  Expressions which are c o n d i t i o n s i n a  SELECT  function  c u r r e n t EVAL box,  are  animated  while  all  to  the  other  COND  or  r i g h t of the  expressions  are  animated so as to appear d i r e c t l y below i t . 4. Throughout may  the  animation, the d e f i n i t i o n of a f u n c t i o n  be d i s p l a y e d at the top of  the  screen,  and  the  p o r t i o n of i t t h a t i s c u r r e n t l y being animated w i l l intensified. e x a c t l y how to  The  viewer can t e l l  e a s i l y a t any  the form c u r r e n t l y being e v a l u a t e d  be  time  relates  the o v e r a l l f u n c t i o n d e f i n i t i o n .  5. The LISP stack or a s s o c i a t i o n l i s t *  optionally  displayed  on  bindings.  Changes i n these are shown as they  6. Whenever  the  encounters display  be  the screen, as w e l l as c u r r e n t v a r i a b l e  EVAL  animation  or  the  stack  occur. display  the border of the d i s p l a y area, p a r t of the  is  "rolled  off"  the screen and  thus f r e e i n g space on the d i s p l a y evaluation  may  disappears,  screen.  When  i s e x i t i n g the r o l l e d p o r t i o n s reappear  the on  the s c r e e n .  2-2  SINGLENFRAME VS.. REAL-TIME ANIMATION A computer system to produce general-purpose,  animation  probably  would  high  quality  have to produce one frame a t a time,  L I S P systems commonly use e i t h e r a stack or a s s o c i a t i o n list (commonly c a l l e d the " a - l i s t " [16]) to save v a r i a b l e bindings. ANTICS w i l l animate e i t h e r method. 6  given the present s t a t e o f the development of computer  graphics  systems. A h i g h p r i o r i t y i n the design of ANTICS was t h a t the system be  able  to  produce animation  i n "real-time."  T h i s means t h a t  someone c o u l d look a t t h e d i s p l a y screen and see exactly  as  i t would  appear  in  a finished  the  film.  animation There were  s e v e r a l reasons f o r t h i s : 1. The implementation all  testing  o f ANTICS would be very d i f f i c u l t  i f  had t o be done by f i l m i n g one frame a t a  time. 2. The p r o d u c t i o n of p r o p e r l y timed f i l m s f o r classroom use a l s o would be very  difficult.  3. A r e a l - t i m e system a l s o c o u l d be made this  would  provide  perhaps expensive, 4. Many animation time.  It  an  extremely  teaching  systems have would  be  that t h i s i s not always  at  quality The g o a l implementation l i g h t of the  a  scan  v e r s a t i l e , though  produced  one  frame  at  a  v a l u a b l e t o help to demonstrate necessary. made  to  display  one  i f t h i s i s needed to produce high  film.  of  producing  difficulties, first  two  s i n g l e - f r a m e animation the  time  and  tool.  5. A r e a l - t i m e system e a s i l y can be frame  interactive,  a  real-time  system  caused  some  but these were c o n s i d e r e d minor i n  reasons  given  above.  i s much, more complicated  In  addition,  or impossible i f  time of the d i s p l a y screen i s l o n g e r than the l o n g e s t  camera s h u t t e r time, and t h i s i s the case with a v a i l a b l e equipment.  (See Appendix A, S e c t i o n  ANTICS 8.)  and  the  15  2^3  SCRIPT DESIGN It  would  was be  assumed  a  that  relatively  a  a  film  (called  especially simplified. would  also  be  making a f i l m  sophisticated  i n s t r u c t o r or a s s i s t a n t ) , and produce  person  LISP  user  of i n p u t .  (a  course  t h a t the i n s t r u c t i o n s necessary  the  script)  On the  other  would hand,  not  need  since  the  to  to be system  i n t e r a c t i v e , a r e l a t i v e l y naive LISP programmer  should be able to produce i n s t r u c t i v e animation or two  with ANTICS  The  r e s u l t was  with only a l i n e  the f o l l o w i n g design:  1. A s i n g l e command, #EVALQ, w i l l animate the e v a l u a t i o n of a f u n c t i o n once i t has been d e f i n e d . 2. S e v e r a l  simple  displays. 3. A d d i t i o n a l  commands  control  the  other  basic  (#SH08, #STAR, #DISPLAY and #DEFON.) commands provide more e l a b o r a t e c o n t r o l  d e t a i l s of the  animation.  4. A s o p h i s t i c a t e d user may definitions  of  over  the  i n s e r t "breakpoints" functions  into  the  to be e v a l u a t e d .  The  b r e a k p o i n t s can c o n d i t i o n a l l y change minor d e t a i l s the 5. A  in  animation.  general-purpose  graphics  build special displays text  and f i g u r e s .  language  such  as  is  titles,  available  to  explanatory  T h i s language i s compatible  with a  subset of GLISP [ 1 1 ] . The syntax and  choice of the syntax of of LISP.  Care was  commands  is  limited  by  the  taken to make the order of parameters  s e l e c t i o n of d e f a u l t values as  consistent  and  logical  as  possible. Timing  i n f o r m a t i o n could be i n d i c a t e d i n the s c r i p t i n two  16  ways: by i n c l u d i n g an a b s o l u t e s t a r t i n g time as command,  or  interval.  by  providing  The second  a  command  to  part  wait  a  of  every  given  time  method was chosen because i t was simple t o  implement and because i t made t h e r e o r g a n i z a t i o n of s c r i p t s much less  complicated. The types of commands that a r e allowed i n the s c r i p t can be  broken down i n t o s e v e r a l groups: displays;  a  second  one group  controls  the  major  group c o n t r o l s d e t a i l s of the animation; a  t h i r d group i s concerned  with d e t a i l s o f producing  films,  such  as t i m i n g and camera c o n t r o l . The  reader should r e f e r t o Appendix A, S e c t i o n 1 (page 39)  which c o n t a i n s a simple annotated  script.  2 i i GRAPHICS PRIMITIVES In general  order t o provide f l e x i b i l i t y t o the user purpose  of  g r a p h i c s language was p r o v i d e d .  ANTICS,  a  The f o l l o w i n g  p o i n t s were c o n s i d e r e d : 1. The user would diagrams,  most  likely  want  and explanatory t e x t .  to  produce  titles,  She a l s o may want to  h i g h l i g h t p o r t i o n s of the animation by adding  special  e f f e c t s such as p o i n t e r s o r o u t l i n i n g boxes. 2. I t  should  be p o s s i b l e to i n c l u d e f i g u r e s sketched  with  the l i g h t pen o r data t a b l e t . 3. The g r a p h i c s language should be easy t o l e a r n . An obvious c h o i c e was t o base the g r a p h i c s  language  subset of GLISP, a LISP based g r a p h i c s language [11 ]. a  on  a  GLISP has  u s e f u l s e t of p r i m i t i v e f u n c t i o n s f o r drawing l i n e s and t e x t .  17  I t a l s o allows the user t o sketch f i g u r e s with the l i g h t pen data t a b l e t and screen,  and  to a d j u s t t h e i r s i z e and p o s i t i o n on the d i s p l a y  also  to  GLISP i s supported The  6  was  possible  e f f e c t and  (page 45)  graphics  A  data s t r u c t u r e s are i n the form of  to  use  to ANTICS  was  simple.  It  the GLISP p r i m i t i v e s while w r i t i n g  A d d i t i o n a l p r i m i t i v e s were added to produce " i n v i s i b l e hand drawing."  language.  Appendix  A,  a  (Appendix A, S e c t i o n  Section  the 10  use  of  (page  60)  the is a  of g r a p h i c s p r i m i t i v e s . )  HOMAN FACTORS AFFECTING DESIGN Since ANTICS i s an e d u c a t i o n a l t o o l ,  consider  i t s design i n t h i s r e s p e c t .  representation another  of  t h i s was The  concepts  falls  effort  was  made  At one l e v e l , the under  graphic At  of the animation  were  ANTICS a l s o i s an i n t e r a c t i v e g r a p h i c s system,  and  the t i m i n g and sequencing  this  to  category.  level,  considered.  taken i n t o account i n i t s design. graphical  e s t a b l i s h e d standard its  Furthermore,  w e l l documented.  c o n t a i n s d e t a i l e d i n s t r u c t i o n s on  reference l i s t  25  and  and t h e i r adaptation  p a r t s of ANTICS. fade  save f i g u r e s i n a l i b r a r y .  GLISP p r i m i t i v e s and  S-expressions, also  or  design.  however; i t  The is  representation form, and method  based  on  of a  of  S-expressions  there was  not  animating "blackboard"  u n i v e r s i t y course on LISP programming.  7  much  EVAL  latitude  i s not  method  i s a well in  standard  used  This representation  in  a was  CPSC 509, taught by Raymond R e i t e r at the U n i v e r s i t y of B r i t i s h Columbia;, Vancouver, Canada. 7  18  found t o be i n s t r u c t i v e by the i n v e s t i g a t o r and by o t h e r s t a k i n g the  course.  The w e l l - d e f i n e d nature o f EVAL tends to l i m i t the  p o s s i b i l i t y of r a d i c a l l y d i f f e r e n t graphic r e p r e s e n t a t i o n s .  The  r e a l choxces l i e i n the complexity of the f u n c t i o n s animated and the  amount  of  detail  instructor/animator  the  shown,  and  ANTICS  provides  the  ability  to match these c h o i c e s t o the  l e v e l of her s t u d e n t s . The  timing  and  considerations  in  program produced the  "action"  moving  on  any  was  found  were  Early versions of the to f o l l o w . because  The i d e a of a " f o l l o w e r " was the  developed:  screen n a t u r a l l y c a t c h e s the eye and new  area  of  the  t o be very compelling v i s u a l l y —  movement on the screen seems t o l o c k the viewer's  Because o f t h i s , the  important  from one s i d e of the d i s p l a y screen t o t h e  d i r e c t s the viewer's a t t e n t i o n to a Movement  animation  animation that was d i f f i c u l t  moved  figure  of  the design of ANTICS.  other without warning. a  sequencing  rule  for  lengthening  ANTICS*  screen. i n fact,  attention. animation  g i v e s p r i o r i t y t o making the s t a t i c p o r t i o n s o f the f i l m l o n g e r , s i n c e these s e c t i o n s allow the user t o absorb the meaning o f the animation  sequence.  entertainment  Movement  is  a  dominating  element  animation, but i t s use i n i n s t r u c t i o n a l  in  animation  must be c o n s i d e r e d c a r e f u l l y [10, p. 66], The  o v e r a l l speed o f the animation must be slow enough f o r  the viewers to f o l l o w , and t h i s speed i s not easy t o d e f i n e . exact speeds can be recommended, but t h e f o l l o w i n g  points  No  were  considered:  1. Viewers  gain  skill  a t f o l l o w i n g the animation as they  19  become more f a m i l i a r with the form  of r e p r e s e n t a t i o n  used i n the animation. 2. For  naive  perhaps  LISP programmers, "the slower the b e t t e r " i s a  very  realistic  animation.  (On  the  rule  other  f o r the  hand,  an  speed  authoritative  source c l a i m s , " I t has been proved by e x p e r i e n c e the  shorter  the  film  the  more  of  concentration  must  the  student  that  effective  i n s t r u c t i o n i s l i k e l y t o be, because which  of  the  the  intense  g i v e . . ."  £10, p. 136]) 3. A s h o r t f i l m can be shown and  different  facets  several  times  consecutively  of LISP can be emphasized  each  time by the i n s t r u c t o r . 4. A s u i t a b l e p r o j e c t o r can stop the  animation  i n s t r u c t o r makes d e t a i l e d e x p l a n a t i o n s . The speed o f animation command.  A  one-minute  can  be  8  with  the  (#BATE  0.1)  to  the  One way f o r an i n s t r u c t o r t o decide how f a s t  should be i s t o ask h e r s e l f how devote  to  the  the  #BATE  f i l m can be s t r e t c h e d t o approximately  ten minutes by adding the command script.  adjusted  while  much  lecture  time  ANTICS  animation she  would  s u b j e c t and then t o s c a l e the f i l m a c c o r d i n g l y .  ( A l t e r n a t i v e l y , she might base  the  animation  speed  on  cost.  S e c t i o n 3.4 has d e t a i l s of the c o s t of producing f i l m s . ) Two  important  c o n s i d e r a t i o n s i n the design of i n t e r a c t i v e  If a s i n g l e frame of f i l m i s intended t o be p r o j e c t e d , non-reversed (negative) f i l m should be used, g i v i n g b l a c k lines on a white background. F i l m with a black background i s much more l i k e l y t o melt when the p r o j e c t o r i s stopped. 8  20  g r a p h i c s systems are response time and methods ANTICS' the  response  time  were a f f e c t e d  (See [ 1 7 ] f o r an a n a l y s i s of system response Newman  and S p r o u l l recommend  through a s i n g l e i n p u t user  [18].,  interaction.  has been e x c e l l e n t due t o the design of  s u p p o r t i n g system, and no design d e c i s i o n s  it.  of  times.),  that i n t e r a c t i o n be p r i m a r i l y  device as t h i s i s more g r a c e f u l  match the c h a r a c t e r i s t i c s of the  of the i n t e r a c t i v e r e q u e s t s : simple a c t i o n s without (A  light  f o r the  iANTICS p r i m a r i l y uses the Adage f u n c t i o n  s i n c e they most n e a r l y  pen  menu  also  fits  this  buttons, majority  parameters.  a p p l i c a t i o n , but was not  c o n s i d e r e d s e r i o u s l y s i n c e the d i s p l a y screen must be l e f t for  filming.)  I n s p e c i a l cases other input  d i a l was used t o adjust learn The  the  only  was  used  variables  to  for  "backing-up"  the  animation  be changed s i n c e p o i n t i n g  practical alternative. how  Interacting the  to  use  the  The keyboard  the  given high  (Appendix A, S e c t i o n interactive  to  and  i s a natural was  user,  but  goal  used  to  (page  42)  of ANTICS.)  can be  confusing  i n ANTICS, which i s p r i m a r i l y an animation  of p r o v i d i n g  priority.  3  features  with s e v e r a l d e v i c e s i n s u c c e s s i o n  system, the methods described and  easy  A  animation commands and new atomic v a l u e s s i n c e i t was the  describes  for  d e v i c e s were used.  the animation r a t e s i n c e i t i s  way t o accomplish these o p e r a t i o n s . enter  clear  r e l a t i o n s h i p between the d i a l p o s i t i o n and t h e r a t e .  l i g h t pen  selecting  by  were found t o be n a t u r a l  to  use,  a s i n g l e i n t e r a c t i v e medium was not  21  CHAPTER I I I - IMPLEMENTATION  T h i s chapter i s concerned implementation  of ANTICS.  refers  to  mainly  structure  factors  of s i m i l a r  implementation  environment  which  affected  and which may  of  the  the  it  overall  be of i n t e r e s t t o  systems.  the  of  of  ANTICS  is  dependent  hardware and software.  interactive  nature  of  the implementation  environment  systems however, and i t may  on  a  unique  T h i s i s unavoidable  ANTICS:  systems tend to be hardware dependent. of  aspects  SYSTEM ORGANIZATION The  to  important  I t does not cover every d e t a i l —  of the implementation  f u t u r e implementors  Iii  the  with  interactive  due  graphics  The g e n e r a l o r g a n i z a t i o n  i s f a i r l y t y p i c a l of g r a p h i c s  be p o s s i b l e t o modify ANTICS t o work  on other systems without undue e f f o r t .  JAIA-I The The Graphics  Adage Graphics Terminal ANTICS system Terminal  is  which  implemented communicates  on  a  with  Model an  IBM  10  Adage 370/168  computer o p e r a t i n g under the Michigan Terminal System £ 3 j . user  communicates  with  S t a t i o n which i s l o c a t e d  the next  370 to  Refer to [ 4 ] f o r more i n f o r m a t i o n . .  through the  an IBM  Adage  The  3270 D i s p l a y  display  screen.  22  2 The GRAPH Super v i s o r Program The  Adage G r a p h i c s Terminal c o n t a i n s a s u p e r v i s o r y  program  named GRAPH which s i m u l t a n e o u s l y c o n t r o l s the r e f r e s h i n g of t h e display  screen  and  [6],  The s u p e r v i s o r  word  i n the  handles communication with t h e IBM 370/168 c o n t a i n s a 6000 word d i s p l a y b u f f e r .  buffer  e i t h e r causes a v e c t o r  d i s p l a y screen o r causes one o f t h i r t y - e i g h t to  be  performed,  vectors,  such  as  scaling  to be drawn on the control  functions  the s i z e o f the f o l l o w i n g  d i s p l a c i n g the X and Y axes of t h e d i s p l a y ,  t o a new l o c a t i o n i n the b u f f e r , e n a b l i n g pen,  branching  o r d i s a b l i n g the l i g h t  modifying other c o n t r o l words, e t c .  The s u p e r v i s o r  commands i n t o t h i s b u f f e r a t any time under c o n t r o l o f 370/168, l i g h t pen,  and  returns  t o the 370 any user i n p u t  or f u n c t i o n  Each  places  the IBM  from the d i a l s ,  buttons which a r e a t t a c h e d to  the  Adage  routines  which  Graphics Terminal.  3.1.3  LISPBASIC LISPBASIC  i s a  package  of  LISP-callable  communicate with GRAPH through the standard  FORTRAN  interface,  AGTBASIC[7].  The LISPBASIC r o u t i n e s [ 1 2 ] assemble Adage  and  words,  control  b l o c k s of v e c t o r s Terminal l i g h t pen.  translate  and  control  t o be d i s p l a y e d ,  vectors  text i n t o display vectors, words  to  the  Adage  send  Graphics  and read the Adage buttons, d i a l s and  LISPBASIC provides only  of the Adage Graphics T e r m i n a l .  the most  primitive  control  23  3±lsJi LISP/MTS ANTICS  i s w r i t t e n i n LISP/MTS [ 2 0 ] , an i n t e r p r e t e r s i m i l a r  to LISP 1.5 [ 1 6 ] .  LISP/MTS uses an i n t e r n a l stack  an a - l i s t as do LISP 1.5 and s e v e r a l other  LISP  animation which i s produced r e f l e c t s t h i s aspect several  other  rather systems.  EVAL f u n c t i o n these d e t a i l s could be changed e a s i l y .  compiler  be  significantly  cheaper  to  9  The  of LISP/MTS and  minor d e t a i l s , but s i n c e ANTICS c o n t a i n s  probably would  than  run  i t s own  The system i f a  LISP  were used.  3.. 2 DISPLAY FILE ORGANIZATION The  organization  of  the  contents  of t h e Adage Graphics  Terminal b u f f e r , r e f e r e d to h e r e a f t e r as t h e d i s p l a y altered  several  ANTICS.  Newman and S p r o u l l provide  l o g i c a l design actual  times  of i d e a l  display  file  the  display stayed  hardware and software The  in  course  fairly  c h i e f f a c t o r was the design  was  the development o f  excellent information  files  limitations  of  file,  [18].  In  on the  ANTICS  the  f a r from the i d e a l due t o  and  design  considerations.  goal o f keeping ANTICS  real-time  and i n t e r a c t i v e . There  are  three  basic  l i m i t a t i o n s i n t h e Adage  system which a f f e c t e d the d i s p l a y f i l e o r g a n i z a t i o n The  first  is  that  the  slow, s i n c e a l l c h a r a c t e r s 370/168) and d i s p l a y e d  INTERLISP [ 19, p. 12. 2]. 9  uses  in  ANTICS.  Adage Graphics T e r m i n a l i s r e l a t i v e l y are generated by software  as a s e r i e s of v e c t o r s ,  a  graphics  binding  and  ( i n the IBM also  since  method s i m i l a r t o an a - l i s t  24  all  display  file  commands  (except  i n t e r p r e t e d by the GRAPH s u p e r v i s o r . the r o u t i n e flicker  to  when  display  the  commands) a r e  An experimental  CONS-cell  CONS-cell  vector  structures  boxes  were  version of  showed  s e t up as d i s p l a c e d  i n s t a n c e s of one s e t of v e c t o r s which drew the box. box  was  d i s p l a y e d " i n - l i n e " by a separate  the f l i c k e r was e l i m i n a t e d e n t i r e l y . due  to  the  When  each  s e t of draw commands  The f l i c k e r t h e r e f o r e  was  overhead time of i n t e r p r e t i n g ; the displacement  and  jump commands i n the d i s p l a y f i l e . file  extreme  was designed  to  have  a  Because o f t h i s , t h e d i s p l a y  limited  number  of  interpreted  commands. . The Terminal Y be  second  hardware  of  the  Adage  Graphics  i s r e l a t e d t o the way v e c t o r s are d i s p l a y e d : the X and  coordinates made  of a v e c t o r command are a b s o l u t e — t h e y  relative  registers,  known  v e c t o r , and these set  limitation  of v e c t o r s .  to  the  previous  vector.  There  may n o t a r e two  as DX and DY, which are used to d i s p l a c e each provide f o r movement or  displacement  o f any  There i s no way t o increment o r decrement  these  r e g i s t e r s , and t h e r e f o r e they can not be used t o produce s e v e r a l l e v e l s of displacement.  T h e r e f o r e , any h i e r a r c h y b u i l t i n t o the  display  f i l e can have only one l e v e l of c o o r d i n a t e  provided  by the system.  The it  displacement  t h i r d l i m i t a t i o n i n the Adage g r a p h i c s system  i s impossible t o t e l l which i n s t a n c e of a s u b r o u t i n e  selected  by the l i g h t  coded as one s e t of locations  pen.  vectors  i s that c a l l was  For example, i f a l l EVAL boxes were which  was  displaced  to  various  on the d i s p l a y screen, a l i g h t pen h i t o f a box would  only i n d i c a t e t h a t a box was h i t and not which i n s t a n c e  of the  25  box.  T h i s problem can be s o l v e d only by a major r e v i s i o n . o f the  GRAPH  s u p e r v i s o r which would r e t u r n a stack c o n t a i n i n g a l l jump  addresses which had occurred before the l i g h t pen h i t . In a d d i t i o n to these hardware c o n s t r a i n t s , factors  affected  the  several  display f i l e organization.  design  In order f o r  the system t o be i n t e r a c t i v e and r e a l - t i m e , the d i s p l a y may be  interrupted  in  order  to  reorganize  "garbage c o l l e c t " i t , f o r example).  not  the d i s p l a y f i l e (to  As a r e s u l t , f i x e d  portions  of the d i s p l a y were s e t a s i d e f o r s e c t i o n s of the ANTIGS d i s p l a y file  which v a r i e d i n l e n g t h , such as the atomic values d i s p l a y e d  by the #DISPLAY command and the value r e t u r n e d  from EVAL.,  Another design c o n s t r a i n t r e s u l t e d from the need t o be a b l e to  move p a r t s of the d i s p l a y i n order t o provide animation.  design  of  the  relationship  display  of  vectors  v e c t o r s which a l l must frame animation are  file  must  that  take  will  disappear  into  account  move t o g e t h e r ,  simultaneously.  the d i s p l a y f i l e can be r e o r g a n i z e d  the  as w e l l as In  single-  when changes  made i n the d i s p l a y to produce movement, but i n a r e a l - t i m e  or i n t e r a c t i v e system,  the  carefully  account  taken  into  possibility at  of  all.,  movement  must  a number of v e c t o r s ,  provides  and  the  one l e v e l of displacement  Adage  graphics  Several  applied  system  commands, the o v e r a l l  of the d i s p l a y f i l e must take i n t o account the v a r i o u s displacement  be  Also, since real-time  movement i s produced by slowly changing t h e displacement to  The  only design  uses  of  commands. false  starts  F i g u r e 3 i l l u s t r a t e s the d u r i n g the animation  were  final  made design  of evaluation.  on d i s p l a y f i l e f o r the  design:  display  file  j  26  ADDRESS;  SCALE  1.0  Control  CAMERA  ON/OFF  section  NULL/JUMP LIGHTPEN  ON  INTENSITY * "STEP" INTENSITY  NORMAL  "AUTO" LIGHTPEN  OFF  JUMP EVAL-RETURN  SKIPZ INCR DY LIGHTPEN  FWA-DISPLAY  OFF  JUMP  (to  stack)  LIGHTPEN  ON  ftDISPLAY  INTENSITY  *  command section  "X  value JUMP unused INTENSITY * "Y = " e t c . INTENSITY  NORMAL  LIGHTPEN  OFF  box  Figure  around  variables  ADDRESS: FWA-STAR  #STAR  INTENSITY BRIGHT  command f u n c t i o n name  section  INTENSITY NORMAL function, prettyprinted, normal i n t e n s i t y commands i n t e r s p e r s e d INTENSITY NORMAL underscore FWA-FOLLOWER  FWA-RETVAL  pjLL/JUMB  Follower  SKIPZ  *  INCR  *  DX  *  SKIPZ  *  INCR  *  DY  *  section  JUMP/ INTENSITY BRIGHT * SKIPZ  Return  INCR  *  value  DX  *  section  SKIPZ  *  INCR  *  DY  * return value  JUMP  * unused  F i g u r e 3 - continued  I  n i  ADDRESS: EVAL-ROLL  SKIPZ  EVAL  INCR  animation  DY  section  INTENSITY NORMAL DX LIGHTPEN  ON  NULL/JUMP *  JUMP-ROLL  EVAL d i s p l a y d i s p l a y produced by b r e a k p o i n t s  temporary d i s p l a y such as EVLIS values EVAL-RETURN  JUMP  (LOCLIST)  free space  (STACKLIST)  stack entry  Stack display  NULL/EOL stack e n t r y NULL/EOL etc. 6001  EOL  F i g u r e 3 - continued  section  29  The It  c o n t r o l s e c t i o n o f the d i s p l a y f i l e  includes  operation  the b a s i c s c a l i n g command, commands to of  "buttons" .  the  camera  automatically,  and  buffer  address  stack d i s p l a y , and a f i x e d address where  can  return. fDISPLAY  d i s p l a y of allocated  two  the  light  pen  f o r t h e displacement commands which  the  The  control  I t a l s o c o n t a i n s a short s e c t i o n which p r o v i d e s  1 0  fixed  always i s p r e s e n t .  command  variables.  A  section fixed  the  EVAL  a  roll  display  i s omitted i f there i s no  number  of  buffer  words i s  f o r each atomic value so t h a t the d i s p l a y need not be  r e o r g a n i z e d when values change. intensity  values  are  I n t e n s i t y commands with  inserted  betweeen  the  normal  entries.  commands a r e changed when a v a r i a b l e i s b r i g h t e n e d  to  These  indicate  t h a t i t s value has been changed or r e f e r e n c e d . , The the  #STAE  vector  command  section also i s optional.  commands which d i s p l a y  function  definition.  commands  set t o  the  Interspersed  normal  prettyprinted  with  intensity. ,  these  During  evaluation,  these are r e p l a c e d  the  parts o f the f u n c t i o n a r e e v a l u a t e d .  various The  follower  draw the f o l l o w e r on  section  "starred"  are i n t e n s i t y animation  of  with b r i g h t i n t e n s i t y commands as  contains  the vector  commands which  symbol and the necessary commands t o  or o f f and to produce movement.  evaluation  I t contains  turn  I t i s always present  i t  during  animation.  The r e t u r n  value s e c t i o n always i s present during  animation  A " l i g h t button" i s an area of t h e d i s p l a y which may be selected by the l i g h t pen t o t r i g g e r some a c t i o n by the system. U s u a l l y i t i s a word d e s c r i b i n g the a c t i o n . 1 0  30  and c o n t a i n s a f i x e d l e n g t h area which holds the display  return  values.  It  modified i n order to move  also  the  vectors  which  c o n t a i n s commands which are  return  value  and  to  make  all  the  it  disappear. The  EVAL  animation  commands producing evaluation exiting. as to  needed  evaluation  to  this  animation.  section,  T h i s s e c t i o n begins  and  display  Each  removes  level  to s k i p p a r t of i t when  on the s c r e e n .  The  properly.  section During  the beginning  so  the  more  space  is  with a jump back to display  is  entered of of  has placed i t s d i s p l a y commands.  display  s e c t i o n s t a r t s at the end of the Adage  e x i s t s only during e v a l u a t i o n animation.  entries  buffer.  A jump t o the beginning  control  necessary  LOCLIST i s a l i s t of addresses  display  disappear  stack  here  of the Adage b u f f e r l o c a t i o n s where each l e v e l  stack  b u f f e r and  that  animation,  the the EVAL animation The  s e c t i o n must end  of  from i t upon  with commands which are  the d i s p l a y and  the c o n t r o l  the  contains  D i s p l a y s produced by user breakpoints are p l a c e d  well. roll  adds  the  section  New  stack  are added to the beginning o f t h i s area o f the  section.  When  of t h i s s e c t i o n i s  parts  of  located  in  the s t a c k d i s p l a y must  because i t has been r o l l e d p a r t i a l l y  off  the  screen,  an  e n d - o f - l i s t i n d i c a t o r i s placed i n one of the words reserved  for  t h i s purpose.  STACKLIST i s  a  list  of  d i s p l a y b u f f e r where each stack e n t r y s t a r t s . made  by  an a - l i s t  addresses  in  Stack e n t r i e s are  both LAMBDA-expressions and PROG f u n c t i o n c a l l s . i s d i s p l a y e d i n p l a c e of a s t a c k , a  the  fixed  number  Hhen of  b u f f e r words i s set a s i d e f o r each e n t r y so t h a t the d i s p l a y can be changed i f values are changed by SET  or SETQ.  31  3-.1 METHODS DSED IN THE PROGRAM The  heart of ANTICS i s a s e t o f LISP f u n c t i o n s c o n s t i t u t i n g  a v e r s i o n of the LISP EVAL f u n c t i o n . of  EVAL.)  This  version  (See [ 1 6 ] f o r a d e f i n i t i o n  of EVAL i s i n t e r s p e r s e d with c a l l s t o  animation r o u t i n e s , and t h i s i s how a l l animation The  stack,  variable  and  "star"  displays  is  produced.  are a l s o d r i v e n by  ANTICS EVAL, and user breakpoints are detected and processed it. of  by  As a r e s u l t , the animation n a t u r a l l y f o l l o w s the execution EVAL and ANTICS has a simple u n d e r l y i n g s t r u c t u r e . The  h i g h l i g h t i n g o f the " s t a r r e d " f u n c t i o n by  p a r t s o f i t as animation breakpoints  into  breakpoints.  intensifying  progresses i s accomplished  i t s definition  which  These c o n t a i n the Adage  are  buffer  by i n s e r t i n g  similar  t o user  address  where  a  word has been r e s e r v e d ; ANTICS EVAL i n t e r c e p t s these b r e a k p o i n t s and  places  an i n t e n s i f y command i n the b u f f e r l o c a t i o n .  (Both  types of breakpoints must be detected and i g n o r e d a t many  other  p l a c e s i n ANTICS.) Interactively  "backing up" the system i s done by using the  LISP/MTS UNEVAL f u n c t i o n to r e t u r n t o h i g h e r  levels  of  ANTICS  EVAL, and c l e a r i n g p a r t o f the d i s p l a y . The  r o u t i n e which d i s p l a y s CONS-cells  methods. itself  When given a l i s t recursively  which  was  i t draws a CONS box, and then  with the CAR o f t h e l i s t .  i s a p a i r of dimensions display  indicating  generated.  the These  l o c a t e the d i s p l a y of the CDR which i s recursive  call.  a l s o uses some novel calls  The r e t u r n value  physical  size  dimensions generated  of  the  a r e used t o by  a  second  32  iii  COST AND EXECUTION TIME It  was o r i g i n a l l y assumed that ANTICS would be expensive t o  use s i n c e i t combined computer  two r e l a t i v e l y expensive items i n terms of  charges: LISP and g r a p h i c s .  c o s t s were not p a r t i c u l a r l y animated  films  minute-twenty recursive  low,  but  Development the  cost  and debugging of  has turned out to be s u r p r i s i n g l y low.  second f i l m  function  illustrating  the  execution  of the  5.4 seconds o f c e n t r a l p r o c e s s o r t i m e .  (The s c r i p t f o r t h i s f i l m i s i n c l u d e d i n Appendix B.) film  A three  MEMBER was produced f o r a t o t a l computation  cost of $4.23 u t i l i z i n g  of  producing  The  1 1  cost  and p r o c e s s i n g was $7.50., The example should probably  have been slowed down two or three times t o make follow.  This  would  only  i t easier  to  add a s l i g h t a d d i t i o n a l computation  charge, as only the e l a p s e d time and v i r t u a l memory usage  would  increase.  1 1  version system.  The c o s t c o u l d be reduced even further i f a compiled of ANTICS was used r a t h e r than t h e present i n t e r p r e t i v e  33  CHAPTEE IV - CONCLUSIONS  COMPARISON WITH EXISTING SYSTEMS Few  program  is difficult  t o compare ANTICS to  strong p o i n t s — not  found  animation systems have been developed, and i t  in  i t s cheapness and any  One  thing  subject  that  that  in  [2].  areas  quite  style  of  to  example, by  PL/1  students  presentation,  animating  EVAL  improvement  the  quickly. 2900  system  features  are f a m i l i a r with  system  itself.  A  could  be  the  script  for  of the  used, (For  this  is  ANTICS  which c o u l d be added to the present  would permit more complex f u n c t i o n s t o be of  animation  B.)  I i 2 POSSIBLE IMPROVEMENTS TO  words  from  i l l u s t r a t e general properties of algorithms.  i n c l u d e d i n Appendix  An  different  ANTICS* primary use i s to teach  A f t e r LISP i s mastered and  perhaps,  are  can be s a i d i s t h a t ANTICS i s not a  LISP.  ANTICS'  ANTICS*  A l s o , e x i s t i n g systems have  g e n e r a l system i n the same sense as the described  exist.  interactive capability —  other systems.  been designed t o present ANTICS*.  those  Adage Graphics Terminal  (The d i s p l a y of F i g u r e 2  animated.  The  b u f f e r are f i l l e d  (page 12)  uses  system 6000 fairly  approximately  words.) In the c u r r e n t implementation of ANTICS, when p a r t  of the d i s p l a y has r o l l e d o f f buffer.  This  the  screen  it  remains  in  the  part of the d i s p l a y b u f f e r c o u l d be saved i n the  34  IBM It  37 0/168  memory and the Adage memory c o u l d be made a v a i l a b l e .  would not be easy t o accomplish  this  without  blinking  the  d i s p l a y , s i n c e the c o n t e n t s o f the Adage b u f f e r would have to be reorganized.  Since  animations seems considered  in  the  somewhat detail.  usefulness doubtful,  of  this  long  and  complex  extension  was not  I f t h i s m o d i f i c a t i o n were made, another  m o d i f i c a t i o n probably should be made t o the r o u t i n e s which the  display,  allowing  them  to  roll  to  roll  t h e l e f t as well as  upward.  4^3 SUMMARY A system has been implemented  which animates LISP  The system can be used t o produce animated  films,  programs.  film  strips  and  s l i d e s , o r i t may be used i n t e r a c t i v e l y as an i n s t r u c t i o n a l  aid.  The c o s t o f using the system i s very low compared t o other  systems.  The system w i l l operate o n l y on  configuration,  but  elements  other p o s s i b l e implementations.  of  a  specific  hardware  i t s design could be u s e f u l t o  BIBLIOGRAPHY  36  [1]  Baecker, B. M., Towards Animating Computer Programs: A First Progress Report, Proceedings of the T h i r d N a t i o n a l Research C o u n c i l M a n-C o m p_ute r Communications Seminar. May,  1973, 4 , 1 - 4 . 1 0 7  £2]  Baecker, R. M., Two Systems which Produce Animated R e p r e s e n t a t i o n s o f the Execution of Computer Programs, SIGCSE B u l l e t i n , Feb., 1975, V o l . .7 No.,1, pp. 158-167.  [3]  C h o i t , M. D. ( e d . ) . The MTS Commands Manual, U n i v e r s i t y of B r i t i s h Columbia Computing Centre, 1970.  [4]  C o u l t h a r d , W. J . , Operator's Manual f o r t h e Adage Graphics Terminal, University of British Columbia Computing Centre, 1970.  £5]  C o u l t h a r d , W. J . , UBC CAMERA - Use of a Camera a t the Adage Graphics Terminal, University of British Columbia Computing Centre, 1972.  £6]  C o u l t h a r d , W. J . , UBC GRAPH - A Simple I n t e r a c t i v e G r a p h i c s Package, U n i v e r s i t y o f B r i t i s h Columbia Computing C e n t r e , 1971.  £7]  C o u l t h a r d , W. J . ; DeKleer, J . , UBC AGTBASIC - Basic Communications Package f o r the Adage G r a p h i c s Terminal, U n i v e r s i t y o f B r i t i s h Columbia Computing Centre, 1971.  £8]  F e u r z e i g , W.; Papert, S.; e t . a l . , Programming Languages as a Conceptual Framework f o r Teaching Mathematics, B o l t Beranek and Newman Inc. Report 1889, 1969.  £9]  Friedman, P., An I n t e r a c t i v e Debugging Package f o r LISP/MTS, Haster's Thesis, University of B r i t i s h Columbia, Department of Computer S c i e n c e , 1973.  £10] Halas, J . ; Manvell, R., The Technique of F i l m Communication A r t s Books, New York, 1971.  Animation,  £11] H a l l , W.; Jervis, B.; J e r v i s , J . , GLISP - A LISP Based Graphic Language, U n i v e r s i t y of British Columbia Department of Computer S c i e n c e . £12] H a l l , W.; Jervis, B.; J e r v i s , J . , LISPBASIC - A LISPAGTBASIC I n t e r f a c e , U n i v e r s i t y of British Columbia Department of Computer S c i e n c e , 1973. £ 1 3 ] Hopgood, F. R. A., Computer Animation Used as a Tool i n Teaching Computer Science, Proceedings of the 1.974 International Federation of Information P r o c e s s i n g S o c i e t i e s Conference, North-Holland P u b l i s h i n g Co., 1974, pp.~889-892.. "  37  [ 1 4 ] Knowlton, K. C. , Computer Produced 26, 1965, V o l . 150, p. 1116.  Movies,  Science,  Nov.  [ 1 5 ] Knowlton, K. C , 16: B e l l Telephone L a b o r a t o r i e s Low L e v e l Linked L i s t Language, two black and white sound films. B e l l Telephone L a b o r a t o r i e s , J3urray H i l l , N.J., 1966. [ 1 6 ] McCarthy, Manual,  J . ; L e v i n , M. I . , e t . a l . , LISP 1 ..5 Programmer's M.I.T. P r e s s , 1962.,  [ 1 7 ] M i l l e r , R. B., Response Time i n Man-Computer C o n v e r s a t i o n a l T r a n s a c t i o n s , Proceedings of the F a l l Joint Computer C o n f e r e n c e 1968. V o l . 33, pp. 267-277. f  [ 1 8 ] Newman, W. M.; S p r o u l l , fl. F., P r i n c i p l e s of I n t e r a c t i v e Computer G r a p h i c s , McGraw-Hill, New York, 1973. [ 1 9 ] T e i t e l m a n , W., e t . a l . , 1NTERLISP Reference Manual, Palo A l t o Research Center, 1974. [ 2 0 ] Wilcox, B.; Hafner, U n i v e r s i t y of B r i t i s h Science, Sept., 1974.  Xerox,  C, IISP/MTS User^s Guide, Columbia Department of Computer  38  APPENDIX  /  39  APPENDIX A - ANTICS 0 S E E 1 S GUIDE  USING THIS GUIDE Reading  Sections  1  and  2  is  a  bare minimum f o r using  ANTICS.  A c a s u a l user w i l l want t o read S e c t i o n s 1  and  advanced  an  All  user  or film-maker  users w i l l want to r e f e r  This  guide presupposes  to  through  5,  should read a l l s e c t i o n s .  Section  9,  ANTICS  commands.  some f a m i l i a r i t y with LISP/MTS [ 2 0 ] , MTS  [ 3 ] and the Adage Graphics Terminal [ 4 ] ,  Is. THE ANTICS SCRIPT The script. entirely  i n p u t t o ANTICS i s a s e r i e s When on  a  an  interruptions,  movie MTS  is  file  which  LISP  being produced  so  would  of  that  the  called  be  read  without  t i m i n g o f the movie.  There i s no reason why the s c r i p t cannot be entered one l i n e a  time  when  experimenting  the  system  with i d e a s .  i s being used A script  a  t h i s s c r i p t must be  i t can  confuse  forms  interactively  at  or while  may c o n s i s t o f s e v e r a l l i n e s  to produce an animation o f a s i n g l e LISP e v a l u a t i o n , o r  i t may  c o n t a i n a hundred or more l i n e s to produce a complete movie with titles  and  rudimentary  explanatory animation:  text.  The f o l l o w i n g s c r i p t produces a  40  (#START) (DEFON MEMBER (THING LIST) (COND ( (NULL LIST NIL) ((EQUAL THING (CAR LIST)),LIST) (T (MEMBER THING (CDR LIST)) ) ) ) (#DISPLAY THING LIST) (#8AIT 5) (tEVALQ  (MEMBER  «A ' (C A T) ) )  #STAST i n i t i a l i z e s screen.  BEFUN  u s u a l way. THING  simply  some parameters and blanks  the  defines the function o f i n t e r e s t i n the  #DISPLAY causes t h e names and v a l u e s  and LIST t o be d i s p l a y e d on the s c r e e n .  of  t h e i r values change.  the atoms  They w i l l remain  u n t i l the screen i s blanked, and the d i s p l a y . w i l l whenever  display  be  changed  #8AIT causes a f i v e second  before the next l i n e of the s c r i p t i s executed.  pause  #EVALQ causes a  complete animation sequence, l a s t i n g perhaps s e v e r a l minutes, of the EVALuation o f the given form. values  of  the atoms  specified  During by  this  animation t h e  the #DISPLAY command a r e  updated c o n s t a n t l y . There a r e two a d d i t i o n a l  major  commands  which  could  be  added to the above s c r i p t anywhere before the #EVALQ command: (#SIACK THING LIST) (#STAE MEMBER) #STACK  causes  the b i n d i n g s of produced  when  a stack t o be d i s p l a y e d . d u r i n g animation showing the atoms the  #STACK  THING command  and LIST. i s given —  shown during t h e animation produced by #£VALQ. a-list  may be d i s p l a y e d i n place of t h e s t a c k .  No  display i s  the d i s p l a y i s Optionally,  an  #STAR causes t h e  41  definition  of  MEMBER t o be shown immediately  display screen. portion be  of  During t h e animation  a t the t o p of the  produced  by  #EVA1Q  the  t h i s " s t a r " f u n c t i o n c u r r e n t l y being e v a l u a t e d  will  intensified. These commands a r e the b a s i c h i g h - l e v e l animation  of  ANTICS.  however, producing  The  by  user  can  selecting  additional  obtain  a  great  options,  changing  graphical  displays  features  d e a l of v a r i e t y , parameters,  with  the  and  graphics  p r i m i t i v e s i n c l u d e d with ANTICS.  2^ HOW TO RON ANTICS Before attempting t o use ANTICS, make sure t h a t supervisor  program  (Either  of  GRAPH  i s running i n the Adage Graphics Terminal.  GRAPH u s u a l l y i s ready; i f i t i s necessary [6],  the  the  current  versions  to  restart  i t ,  see  of GRAPH w i l l work.)  ANTICS may be run by e x e c u t i n g the MTS command: $SOURCE HASD:ANTICS while signed on Graphics and  at  Terminal.  3270  Display  Station  at  the  Adage  A #START command i s executed a u t o m a t i c a l l y  the user may d e f i n e a f u n c t i o n and use #EVALQ immediately t o  see the animation. used  the  to  The PF9 key i s s e t t o " (#BLANK)" and may  c l e a r the screen.  be used t o e x i t from  be  The PF6 key i s s e t t o "NIL" and may  BREAK l o o p s .  A s c r i p t may be read by using  the MTS command: $CONTINUE WITH s c r i p t RETURN where " s c r i p t " i s t h e name commands  comprising  the  of  a  script.  file  containing  the  ANTICS  I f a medium l e n g t h or l o n g e r  s c r i p t i s used, the 3270 D i s p l a y S t a t i o n may go i n t o pause  mode  42  when  the r e t u r n values o f the commands a r e l i s t e d .  T h i s may be  avoided by p l a c i n g a PRGGN c a l l around a l l of the commands or by using the %FAST d e v i c e command t o prevent the 3270 from  Ii  pausing.  USING THE SYSTEM INTERACTIVELY Although ANTICS i s designed p r i m a r i l y f o r making movies, i t  i s f a s t enough t o support i n t e r a c t i v e use. means  of  the l i g h t  Interaction  pen and f u n c t i o n buttons.  i s provided which l a b e l s the f u n c t i o n of the Whenever  ANTICS  i s by  (An o v e r l a y c a r d various  buttons.)  i s w a i t i n g , both of these d e v i c e s are a c t i v e .  During animation, #WAIT i s c a l l e d b e f o r e  and  after  evaluating  each form. There  a r e two modes of i n t e r a c t i v e o p e r a t i o n : STEPMODE and  AUTOmatic.  STEPMODE i s s e l e c t e d by p r e s s i n g the STEPMODE button  (15) o r by using the l i g h t pen i n any way. the  function  #WAIT  always  While  in  STEPMODE,  waits u n t i l e i t h e r the STEP button  (13) i s pushed or the STEP l i g h t button  i s selected  with  the  l i g h t pen. The STEP l i g h t button i s i n t e n s i f i e d while ANTICS i s waiting.  In  AUTO mode, the #WAIT f u n c t i o n waits the s p e c i f i e d  time, unless the STEP button i s pushed  first.  selected  (16) o r by p o i n t i n g t h e  light  by  pressing  the  pen a t the AUTO l i g h t  AUTO button  AUTO  button.  The l i g h t pen has two other f u n c t i o n s as w e l l . it  may be pointed  #DISPLAY,  and  the keyboard. the  at  a  any  mode i s  variable  in  the  list  At any time created  new value f o r the atom may be entered  through  The l i g h t pen a l s o may be pointed t o any p a r t  evaluation  by  of  d i s p l a y , and the animation w i l l back up t o - t h a t  p o i n t and r e s t a r t .  43  There a r e s e v e r a l other buttons which may be time.  The QOIT button  LISP. the  used  a t any  (10) causes a r e t u r n t o the top l e v e l of  T h i s w i l l terminate an animation sequence and proceed next  erased.  command  i n the s c r i p t .  The PLOT button  (9)  The animation d i s p l a y i s not  will  plot  d i s p l a y screen a t the time i t i s pushed. command  #PL0T.  loop f o r debugging  The  BREAK button  purposes.  whatever  i s on the  I t i s i d e n t i c a l t o the  (11) e n t e r s a LISP/MTS break  I f t h i s button has been used,  animation may be resumed by e n t e r i n g NIL from the keyboard using  the  PF6 key.  The CAMERA button  or o f f a l t e r n a t i v e l y , using r e l a y causes  the  to  1. ,  the or by  (12) t u r n s t h e camera on The  BACKUP  button  (5)  l a s t form v i s i b l e on the d i s p l a y o f animation t o be  r e - e v a l u a t e d and animated.  T h i s button i s enabled  only  during  e v a l u a t i o n animation. The  RATE button  (14) reads a value from t h e Adage d i a l  and c a l l s the #RATE command to change T h i s can be used t o experiment the  #RATE  value  the  rate  of  an animation q u i c k l y . when  n  with v a r i o u s speeds of animation;  which was used i s p r i n t e d and a fRATE command  been e s t a b l i s h e d .  responding  A  animation.  l a t e r can be i n s e r t e d i n t o the s c r i p t when an a p p r o p r i a t e has  M  value  High #RATE v a l u e s can be used t o preview (Note that  the  light  pen  has  the animation proceeds too q u i c k l y .  trouble  When t h i s  happens, the STEPMODE button may be used before the l i g h t  pen i s  used.)  i U THE ANTICS EVAL FUNCTION In order t o produce  animation, ANTICS c o n t a i n s i t s own EVAL  44  function This  which i s i n t e r s p e r s e d with c a l l s t o g r a p h i c s  EVAL  contains  some p e c u l i a r i t i e s and l i m i t a t i o n s o f which  the user of ANTICS must be aware.  None o f these a r e r e s t r i c t i n g  to the k i n d of LISP f u n c t i o n s which a r e l i k e l y t o In most r e s p e c t s , other  be  ANTICS' EVAL appears l i k e LISP/MTS r a t h e r than  basic r e s t r i c t i o n i s t h a t the ANTICS EVAL uses i t s own  internal a-list  to  description  the use o f the a - l i s t . ) T h e r e f o r e ,  and  of  store  atomic  values.  (See [ 1 6 ] f o r a  LISP/MTS atoms a r e completely independent RPLACA  are used  atomic v a l u e s ) .  on  atoms —  ANTICS atoms  (except  when  CAR  they w i l l r e f e r to LISP/MTS  T h i s a l s o means that FSOBRs and NSUBRs a l l must  be e x p l i c i t l y coded i n t o t h e ANTICS EVAL, o r e l s e they to  animated.  LISP systems. The  and  routines.  get atomic values  may t r y  from LISP/MTS i n t h e normal f a s h i o n . , The  f o l l o w i n g f u n c t i o n s , normally FSOBRs o r NSUBRs have  been  coded  i n t o t h e ANTICS EVAL: COND  AND  OR  SELECT  PROG  SET  SETQ  SELECTQ  The  following  a v a i l a b l e during  commonly  used  FSOBRs  and  animation:  DEFUN  UNCONS  DEFINE  LABEL  UNTIL  WHILE  DO  STATUS  DEFPROP  A d d i t i o n a l l y , two f u n c t i o n s have been provided script:  #SET and #SETQ.  EVAL  a-list.  use i n t h e  they  work  with the  I f a v a r i a b l e i s s e t which i s not y e t on  the a - l i s t , i t i s appended t o the a - l i s t . from LISP 1.5.)  for  They appear t o work e x a c t l y as SET and  SETQ normally do i n LISP/MTS, except t h a t ANTICS  NSUBRs are not  (This  i s different  45  If  EVAL  or  APPLY  are  called  within  a  f u n c t i o n being  animated, the ANTICS EVIL, or APPLY i s used. EETUEN and GO should only be used d i r e c t l y RETURN  may  not  take  l a b e l name, i t w i l l  a  second parameter.  not c a l l  If name  taken,  and  function d e f i n i t i o n The  v a r i o u s MAP  f u n c t i o n s may  ( C a l l s to ARG  a f u n c t i o n i s undefined  is  if  GO  messages,  PROG.  must be given a  it  may  be used, as w e l l  have only one  then the value of is  not  (as done i n LISP  the  argument.). function  NIL i t i s t r e a t e d as the  1.5).  f u n c t i o n s should not be used.  S i n c e ANTICS EVAL does not c o n t a i n a l l of t h e error  a  EVAL.  FEXPRs, NEXPRs and no-spread as the f u n c t i o n AEG.  within  it  i s important  c o r r e c t before attempting  normal  LISP  to be sure t h a t a f u n c t i o n i s  to animate i t .  5^ ADDITIONAL COMMANDS The command #DEFUN has e x a c t l y the  same  DEFUN, and i n a d d i t i o n i t causes a d i s p l a y . itself  effects The  as  LISP  DEFUN  statement  i s d i s p l a y e d at the top o f the screen, and the  CONS-cell  s t r u c t u r e i s d i s p l a y e d below. The of  command  (#SH08 S X Y) d i s p l a y s the CONS-cell  the given S-expression  X,Y.  Circular  These and  structure  on the s c r e e n , s t a r t i n g a t c o o r d i n a t e s  S-expressions  may  be d i s p l a y e d i n t h i s manner.  other commands are e x p l a i n e d i n d e t a i l i n S e c t i o n 9 .  fLs. GRAPHICS LANGUAGE There i s a g e n e r a l purpose g r a p h i c s language  available  to  46  the  user  of  ANTICS.  I t c o n t a i n s both g r a p h i c s  p r i m i t i v e s and  s p e c i a l f u n c t i o n s f o r d i s p l a y i n g LISP s t r u c t u r e s .  This  graphics  language can be used d i r e c t l y i n the s c r i p t t o produce a v a r i e t y of d i s p l a y s w i t h i n the movie, such as also  can  By  using these b r e a k p o i n t s ,  of  animation  by  explanatory  user  special  breakpoints  which are i n v i s i b l e to of  omitting  ANTICS  may , t a i l o r  unnecessary  detail  messages and f i g u r e s at key  which  It  i n s e r t e d i n t o a f u n c t i o n whose e v a l u a t i o n i s being animated.  the  within  diagrams.  be  movie,  used  and  may  the  be  text  the  viewer  the  evaluation  and  displaying  p o i n t s i n the  animation.  D e t a i l s of the i n d i v i d u a l p r i m i t i v e s are found i n S e c t i o n  6..1 GRAPHICS LANGUAGE WITHIN THE When  a  command  is  When  graphics  SCRIPT  included  d i s p l a y which r e s u l t s i s  shown  primitives  are  10.  i n the s c r i p t , the  automatically used,  on  however,  embedded i n the command #DISP i n order  to  be  graphics  the  screen.  they  must  displayed.  be For  example: (#DISP (*SYMBQL -2.5 (•SYMBOL -2.5 may  be  screen. #BLANK  included The  in  .6  'HELLO  -.6  the  * THERE  1.) 1.))  s c r i p t to d i s p l a y the message on  message w i l l remain on the screen  command.  Successive  until  the  the #WAIT command may  to  or FADE p r i m i t i v e s may  if  the t i m i n g .  The  FOR  i t i s d e s i r e d to have part of the  using  the  FADE or FOR  next  #DISP commands w i l l cause a d i s p l a y  to be b u i l t up on the screen, and control  the  display  turn  off  #BLANK command to c l e a r the e n t i r e d i s p l a y . have caused the e n t i r e screen  to be blanked,  be  used  be used before Even i f #BLANK  47  should  be  used so t h a t a l l l o c a t i o n s i n the d i s p l a y b u f f e r a r e  made a v a i l a b l e .  6.2  GRAPHICS LANGOAGE EMBEDDED IN FUNCTIONS TO BE ANIMATED Breakpoints  evaluated.  may  be  inserted  into  any  function  t o be  of the f u n c t i o n which i s being animated.  Before  The form of a breakpoint i s :  (# ENTRY-FORM FORM EXIT-FORM) FORM  i s part  FORM i s evaluated LISP/MTS.  and  animated,  ENTRY-FORM  may  ENTRY-FORM  contain  i s evaluated  g r a p h i c s p r i m i t i v e s and i t  a l s o may change v a r i o u s parameters e f f e c t i n g progress. After  by,  the  animation  in  (See S e c t i o n 11 f o r i n f o r m a t i o n on ANTICS v a r i a b l e s . )  FORM i s e v a l u a t e d and animated, and the animation d i s p l a y  i s removed from t h e screen, EXIT-FORM,  which  i s optional, i s  evaluated by LISP/MTS. Graphics p r i m i t i v e s may be i n c l u d e d i n ENTRY-FORM, and they will  be  displayed  displayed.  on  the  screen  the  t e x t of FORM i s  The d i s p l a y w i l l remain on the screen u n t i l a r e t u r n  i s made from the e v a l u a t i o n o f desired,  when  FORM.  If  a  the FOR p r i m i t i v e should be used.  shorter  time  is  Graphics p r i m i t i v e s  used w i t h i n EXIT-FORM should be i n c l u d e d w i t h i n the command (#EXIT-DISP SECONDS p r i m i t i v e s ) i n order to be d i s p l a y e d f o r t h e given number o f  seconds.  The  f o l l o w i n g notes apply t o b r e a k p o i n t s : 1.  The text  variables of  animation. generated  FORM  X  and  will  They  may  Y are the c o o r d i n a t e s where t h e be  displayed  be  by the b r e a k p o i n t .  used  to  as  part  locate  o f the displays  48  The v a r i a b l e s #TIMES i s bound to the times  the  particular  breakpoint  w i t h i n the c u r r e n t animation. example,  in  a  total  It  conditional  has  number  been  can  be  expression  Two  has been shown a p a r t i c u l a r  variables,  and may  VAF1  be used to  and  entered  used, to  for  make the  breakpoint*s a c t i o n dependent on the number the viewer  of  of  times  detail.  VAR2, are p r o t e c t e d by a PROG  pass  values  from  ENTRY-FORM  to  EXIT-FORM. The  value  returned  from  the  evaluation  of FORM i s  a v a i l a b l e t o EXIT-FORM as RETURN-VALUE. The animation DISP? t o FORM.  T  may  be  turned  or  NIL.  T h i s may  When animation  displayed  on  the  on  or  addition  NIL,  also  three  dots  setting  three  dots  are  If  OLD-  as an i n d i c a t i o n .  DISP? i s s e t to NIL i n the  by  be done only i n ENTRY-  i s turned o f f ,  screen  off  to  setting  DISP? =  w i l l be omitted from the  display. An ENTRY-FORM can  override  the  effect  of  a  #DEPTH  command by s e t t i n g DISP? to T. FORM  may  be omitted  from a b r e a k p o i n t .  In t h i s  the b r e a k p o i n t c o n s i s t s of ENTRY-FORM alone. be u s e f u l whenever a l i s t as i n PROGs returned  from  significant and  or  of forms i s being  conditional ENTRY-FORM  statements.  is  returned,  case,  This  may  evaluated, The  value  and w i l l  w i t h i n c o n d i t i o n a l e x p r e s s i o n s such  as  be AND  OR.  A dummy LISP/MTS f u n c t i o n named "#  n  is  supplied  which  49  simply  EVALs FORM.  breakpoints If  t o be evaluated  FORM  is  returned. 9.  T h i s permits f u n c t i o n s c o n t a i n i n g  omitted  by LISP/MTS  from  the  for  testing.  breakpoint  NIL i s  (See Note 7 above.)  ANTICS EVAL atomic values the f u n c t i o n •VALUE.  may be  obtained  by  calling  The form i s :  (•VALUE ATOM A ERR) The  value  of  ANTICS a - l i s t returned  ATOM i s the name of the atom, A i s the (named A ) ,  and  ERR  i s evaluated  and  i f ATOM i s undefined.  Is. INTERFACING WITH GLISP Several  of the g r a p h i c s p r i m i t i v e s i n ANTICS are i d e n t i c a l  t o low l e v e l GLISP f u n c t i o n s the  user  of  (See [ 1 1 ] ) .  feature  allows  ANTICS t o c r e a t e SUBROUTINES i n GLISP and i n c l u d e  them as part o f her ANTICS s c r i p t . sketching  This  routines  One  of  the  various  GLISP  can be used t o draw a p i c t u r e which i s then  i n c l u d e d as part of the ANTICS s c r i p t , perhaps as  part  of  the  movie t i t l e s . GLISP  SUBROUTINES which, use the f o l l o w i n g f u n c t i o n s may be  i n s e r t e d d i r e c t l y i n t o the ANTICS s c r i p t :  The  •GOTO  • PLOT  •SYMBOL  •INTENSITY  •DASH  •UNDASH  •FOR  ADJ(without d i a l s )  GPROG  •JUMP  •SKIPNZ  •SKIPZ  SUBROUTINE name must be  SUBROUTINES  may  not  be  included, included  though  within  although •GOTOs, •PLOTS and •SYMBOLS c r e a t e d  it is  ANTICS by  ignored.  breakpoints,  GLISP  may  be  50  included. way that  Note that ANTICS does not t r e a t SUBROUTINES t h e same GLISP  encountered any  way.  into  in  does  —  they  are  displayed  breakpoints,  i t should  by  The  are  SUBROUTINE  GLISP  are  inserted  be remembered that ANTICS  s c a l e i s s e t t o 1.0 while GLISP runs with 0.5.  they  the s c r i p t and they do not need t o be c a l l e d i n  A l s o , when p r i m i t i v e s c r e a t e d  ANTICS  when  a  scale  setting  f u n c t i o n i n ANTICS a u t o m a t i c a l l y  1  of  adjusts  the s c a l e t o 0.5 when GLISP SUBROUTINES are i n c l u d e d d i r e c t l y i n the  script. The  following  GLISP  SUBROUTINE  o u t l i n e s t h e area of the screen and  produces  a  box  which  where ANTICS produces animation,  where a Super-8 mm. camera should  be p o i n t e d .  (SUBROUTINE FRAME (*G0T0 -10. 10.) (*PL0T 10. 10.) (*PLOT 10. -4.8) (*PLOT -10. -4.8) (*PLOT -10. 10.) )  8. PRODUCING FILMS ANTICS can be used to make f i l m s t r i p s , s l i d e s , o r animated films.  Film  strips  (described i n S e c t i o n  or 3.)  slides and  can simply  steps i n the animation seguence [ 5 ]  1 2  .  be  made  using  photographing  suitable  The f o l l o w i n g steps  T h e exposure s e t t i n g s given i n t h i s r e f e r e n c e reduced t o g i v e b e t t e r r e s u l t s . 1 2  STEPMODE  will  might be  51  produce a f i l m with minimum f l i c k e r .  This  elaborate  procedure  i s necessary due t o the i n h e r e n t i n c o m p a t i b i l i t y of the camera's shutter given  speed as  a  and guide  the  Adage  refresh rate.  f o r experimentsation.  The procedure i s Some  details  may  p o s s i b l y be changed -— e s p e c i a l l y the Adage r e f r e s h r a t e and the exposure s e t t i n g . 1. Press the RESET and then the RUN buttons on the Adage d i s p l a y console.  Execute  the HTS command:  $COPY AGT:GRAPH >AGTI 2. Set the Adage r e f r e s h r a t e t o 30 a.  Set  the  switches  times/second:  on the Adage c o n t r o l console t o  22000 01612 (octal) and p r e s s PULSE1. button  register  The  should read 61014 00001  lights  i n the  (octal).  I f they  do not, AGT:GRAPH has been changed. b.  Press RESET  61014 00002  BR  and  set  the  by p r e s s i n g the buttons  button  c.  Set  the  to  (which a l s o l i g h t u p ) .  ( S e t t i n g the buttons to 61014 O0O0N w i l l r a t e t o 120/ (N+2)  register  set  the  refresh  times/second.) switches to 20200 01612 and press PULSE1.  Set the switches t o 20200 00754 and press PULSE1. d.  Place the statement  beginning o f your 3. Set  the  f-stop  on  (SETQ  FRAMES/SEC  In  that  and the f i l m s t i l l motor  at  the  ANTICS s c r i p t . the  NIZO S 56 camera to f/1.8. , I f the  i n d i c a t o r needle f a i l s t o move the dead.  30)  mercury  batteries  are  case, the s h u t t e r w i l l stay open t o f/1.8 w i l l be  properly  exposed.  Check  the  b a t t e r i e s by p r e s s i n g t h e power switch forward — i f  the exposure meter reads t o the r i g h t of f/8 the  batteries  52  are  low.  Set  the camera speed  the f i l t e r f o r a r t i f i c i a l Kodak  "4-X  Reversal  master i n t e n s i t y display  light.  Film  control  screen  should  to 18 frames/second.  7277" knob  be  Load  the  (ASA  400 r a t i n g ) .  located  set  Set  with  camera  under the  with  the  mark  The Adage  pointing  s t r a i g h t down. Set the camera on a t r i p o d about 3 t o 4 f e e t from  the  Adage  d i s p l a y screen. Run  ANTICS.  (See  S e c t i o n 2.)  a d j u s t the camera by t i l t i n g lens.  the  moving the zoom  P r e s s the  STEP  button  the iFOCUS command.  camera  i s connected  t o the Adage r e l a y  the d i s p l a y c o n s o l e ) , the #CAMERA will  a #FOC0S command and  the t r i p o d and  Focus the camera c a r e f u l l y .  (13) t o end If  Execute  t u r n the camera on or o f f .  Appendix B f o r a good way  command  1 (on top of  in  the  script  See the example MEMBER i n  to o r g a n i z e the s c r i p t .  If  the  camera i s being c o n t r o l l e d by the r e l a y , l e a v e the camera's power switch o f f u n t i l you have f i n i s h e d Run  ANTICS  and  expose the f i l m .  The  experimenting.  room l i g h t s should  be  turned o f f and the l i g h t s on the Adage c o n t r o l panel should be covered.  A 50 foot c a r t r i d g e l a s t s 200  frames/second.  To  the STEPMODE button button  (16).  The  of the  more than one c a r t r i d g e ,  (15), change f i l m , and press  camera w i l l be stopped and  Alternatively, by i n i t i a l l y  expose  the  at  18  press  the  AUTO  restarted.  f i l m can be stopped a u t o m a t i c a l l y  s e t t i n g the v a r i a b l e FILM-LENGTH to the number  seconds of f i l m to be exposed. camera  seconds  on  for  this  Hhen ANTICS  has  turned  l e n g t h of time i t w i l l stop the  53  animation  and the camera, p r i n t a message, and e n t e r a LISP  break loop. restart. the  You  may  then change the f i l m and  I f the new  cartridge i s a different  previous  one  you may  type "NIL" length  to  than  change the value of FILM-LENGTH  with SETQ before l e a v i n g the break loop.  This feature w i l l  not stop the camera d u r i n g the time t h a t a #DRAW command i s executing. 8. The a c t u a l e l a p s e d time of a s c r i p t load. fill  T h i s can cause problems i f you are t r y i n g to e x a c t l y a f i l m c a r t r i d g e . , The  a d j u s t the d u r a t i o n of 9. I f  seems t o vary with system  the  ADAGE  is  #RATE command can  be  used  animation.  given frames to d i s p l a y which take l o n g e r  than  1/30  get  an o b j e c t i o n a b l e strobe e f f e c t or f l i c k e r on the  The  to  second, the frame r a t e w i l l change  and  you  may film.  most complex frames i n the HEMBE.fi example, d i s p l a y i n g 7  EVAL boxes, take almost e x a c t l y 1/30 (page 12) .  second.  T h i s f i g u r e r e p r e s e n t s the most  (See F i g u r e 2 complex  frame  of the f i l m . ) To  test  i f frames take longer than the present Adage  r e f r e s h time, s e t the button r e g i s t e r t o the  switches t o 20200 01601, and  t h i s while ANTICS i s running.)  23004 00077,  press PULSE1.  Run  the  (Do not  script,  and  frames take longer than the r e f r e s h time the IC1 l i g h t flash  and  fashion.  the d i s p l a y screen w i l l b l i n k i n an Repeat steps 1 and  I f your animation 1/30  second,  variable  you  names,  may  removing  do  when will  unmistakable  2 to r e s e t t h i s .  has frames which try  set  take  simplifying options,  etc.  longer  than  i t by s h o r t e n i n g You  also  may  54  experiment  with d i f f e r e n t camera speeds and r e f r e s h  F l i c k e r and " s t r o b i n g " can camera^  back  and  looking  shutter i s operating. projection  speed  be  monitored  through  (This  on  the  the  will  work  opening  the  lens  while t h e  only  when  the  i s roughly t h e same as t h e camera speed.)  A f i n a l a l t e r n a t i v e i s t o experiment feature  by  rates.  camera  with  the  slow-motion  while s e t t i n g the animation  very low with t h e #BATE command and the  variables  speed  FOLLOW-  RATE and MOVE-RATE. Remember t h a t i t i s i m p o s s i b l e t o get p e r f e c t exposure of  the  film  as  long  as  the l o n g e s t s h u t t e r time (1/40  second) i s s h o r t e r than the time  required  to  produce  an  image on the d i s p l a y . 11. Bhen  you  a r e f i n i s h e d repeat s t e p 1.  the Adage c o n s o l e to 24000 77776  Set the switches on  (octal).  9.. COMMANDS NOTATION Arguments which are enclosed i n angle brackets (such as <X>), a r e o p t i o n a l ; they may be omitted. Braces i n d i c a t e t h a t one a l t e r n a t i v e should be chosen, as i n {QN,0FF}. Elipses indicate t h a t one or more occurrences of t h e argument may be g i v e n , as i n (#DISPLAY ATOM 1 . . . ATQUS) • underscored parameter i s one which w i l l not be e v a l u a t e d . A r i  Values returned by commands and p r i m i t i v e s a r e meaningless unless s p e c i f i e d .  (#START) #START r e s e t s s e v e r a l ANTICS f e a t u r e s , #BLANKs the d i s p l a y s c r e e n , and i n i t i a l i z e s the timer used by #END. The f o l l o w i n g a c t i o n s a r e a l s o taken: 1. The s t a c k d i s p l a y i s turned o f f (see #STACK) .  55  2.  The animation depth i s s e t t o 10000 (see 4'OEPTH). (#DEPTH = 10000). 3. The animation time delays are r e s e t t o normal. The r a t e s of movement of r e t u r n values and the f o l l o w e r are r e s e t t o normal., (Thus the e f f e c t o f #FAST i s reset.) 4. The d i s p l a y i n g of EVLIS values i s turned on. (EVLIS? = T, EVLIS-NOVE? = T) 5. The movement of r e t u r n values i s turned on. (RETURNS? = T) 6., P r e t t y p r i n t i n g i s s e t so as t o t r a n s l a t e (QUOTE S) t o 'S. (SHORTQUOTE = T ) . 7. The e f f e c t s of a l l tBRIEF and #EXCLUDE commands a r e reset.  (tDEFUN NAME <TYPE> ARGLIST SI .  .  .  Sn)  This i s i d e n t i c a l to LISP/MTS DEFUN. In a d d i t i o n t o defining the function, the DEFUN statement itself i s p r e t t y p r i n t e d a t the top of the d i s p l a y s c r e e n , and a f t e r a s h o r t i n t e r v a l , the CONS-cell s t r u c t u r e o f the r e s u l t i n g LAMBDAe x p r e s s i o n i s d i s p l a y e d below. A #BLANK command normally should be used immediately before #DEFUN, and a s u i t a b l e #WAIT and #BLANK should be used a f t e r i t . (#STAR FN M I ) T h i s command i s used t o name the " s t a r " f u n c t i o n of an evaluation animation and to p r e t t y p r i n t the f u n c t i o n ' s LAMBDAE x p r e s s i o n a t the t o p of the d i s p l a y s c r e e n . I t i s used a f t e r a #BLANK command and b e f o r e one or more #EVAL o r #EVALQ commands. The display w i l l remain u n t i l a #BLANK command i s g i v e n , and only one #STAR command may be given between two #BLANK commands. (#DISPLAY ATOM 1 . . .  .  ATOMn)  The given atoms names, along with their values, are displayed i n t h e upper r i g h t - h a n d c o r n e r o f t h e s c r e e n . The arguments to no-spread LAMBDA-expressions may be d i s p l a y e d by entering numbers i n the l i s t o f atoms: (#DISPLAY 1 N) w i l l d i s p l a y "ARG 1" and N. Any succeeding changes i n the atomic values will be r e f l e c t e d i n t h e d i s p l a y . Whenever ANTICS i s w a i t i n g (the STEP l i g h t button i s i n t e n s i f i e d , ) the d i s p l a y w i l l respond to the l i g h t pen and values may be changed. The d i s p l a y remains on the screen u n t i l the next #BLANK command, and only one #DISPLAY command should be given between two #BLANK commands. Also see the #REDISP command below. 1  56  (#STACK AT0M1 ... (#STACK #ALL7 (#STACK)  .  .  ATOHn)  T h i s command c o n t r o l s the stack d i s p l a y , which i s o n l y apparent d u r i n g the animation produced by #EVAL or #EVALQ. I f a list of atoms i s g i v e n , only the s t a c k b i n d i n g s of those atoms w i l l be d i s p l a y e d d u r i n g animation. The b i n d i n g s of no-spread LAMBDAS may be shown by e n t e r i n g numbers i n the l i s t of atoms. For example, {#STACK N 1) will show the bindings of N and "AEG 1". <#STACK #ALL) causes a l l b i n d i n g s t o be d i s p l a y e d . In either case, every LAMBDA and PBOG w i l l produce at l e a s t an empty entry i n the s t a c k display (a dashed l i n e ) . (#STACK) turns o f f the stack d i s p l a y . The d i s p l a y i s a l s o turned o f f by the #STABT command. I f the v a r i a b l e ALIST? i s non-NIL an a - l i s t i s d i s p l a y e d i n p l a c e of the s t a c k . The #STACK command s t i l l must be given and only the s p e c i f i e d atoms are shown on the a - l i s t d i s p l a y . Bhen SET or SETQ change a value on the a - l i s t the display also i s changed. I f SET or SETQ s e t the value of an atom which i s not on the a - l i s t , the value i s placed on the end of the a - l i s t , but t h i s i s not shown i n the a - l i s t display.. (This would be an e r r o r i n LISP 1.5.) (#EVAL FOBM <ALIST>) (#EVALQ FORM <ALIST>) These both cause the e v a l u a t i o n of FOBM to be animated. #EVAL f i r s t e v a l u a t e s i t s argument with LISP/MTS. When the animation i s f i n i s h e d , the r e t u r n value from the e v a l u a t i o n w i l l be left on the s c r e e n ; i t w i l l disappear when the next #EVAL, #EVALQ, or #BLANK i s encountered. ALIST may be s p e c i f i e d i n the form {{ATOM . VALUE) . . . (ATOM . V A L U E ) ) . The d e f a u l t ALIST contains T, any values s e t by #SET or #SETQ, and "top level'! v a l u e s s e t by SET or SETQ i n previous animations. (#BLANK) T h i s c l e a r s the d i s p l a y screen, except f o r the STEP and AUTO l i g h t buttons when ANTICS i s i n STEPMODE. The e f f e c t s of #STAB and #DISPLAY are r e s e t completely. The #STACK, #BBIEF and SEXCLUDE commands are not r e s e t . (#WAIT SECONDS) ANTICS pauses f o r the given number of seconds. #WAIT i s used i n the script to a d j u s t the t i m i n g of the movie. When ANTICS i s i n STEPMODE, #BAIT always w i l l wait until the light pen i s used or one of the buttons i s used, and i t w i l l stop w a i t i n g o n l y when STEP or AUTO i s s e l e c t e d with the l i g h t pen or buttons. See S e c t i o n 3 f o r more i n f o r m a t i o n .  57  (#END) The camera i s turned o f f and the elapsed time i s printed., '  from  #STAST  (#SET A1 S1 . . . An Sn) (#SETQ Al S1 . . . An Sn) These commands place values permanently on the ANTICS al i s t e x a c t l y as SET and SETQ normally would be expected to do. (LISP 1.5 generates an e r r o r i f atoms are s e t which do not appear on the a - l i s t , while a n t i c s p l a c e s them on the end of the a-list. The r e s u l t appears e x a c t l y l i k e LISP/MTS to the user.) These commands may be used d i r e c t l y i n the script or i n breakpoints. I f the atom whose value i s being s e t i s c u r r e n t l y displayed on the screen (due to a #DISP1AY command) then the change w i l l be recorded i n the d i s p l a y . (SUBROUTINE NAME p r i m i t i v e .  .  . primitive)  The p r i m i t i v e s are d i s p l a y e d immediately, with the scale set to 0.5. NAME i s i g n o r e d . T h i s command i s provided p r i m a r i l y f o r c o m p a t i b i l i t y with GLISP. (See S e c t i o n 6.) (#DRAW N p r i m i t i v e . . .  primitive)  The v e c t o r s and commands generated by the p r i m i t i v e s are displayed on the screen c o n s e c u t i v e l y , at a r a t e determined by N, so t h a t they appear as though they are being drawn by an invisible hand. I f N i s z e r o , the v e c t o r s are placed on the screen one at a time as f a s t as the system permits — roughly 14 per second. I f N i s n e g a t i v e , the v e c t o r s are placed on the screen JN| at a time at the maximum r a t e . If N i s positive, a pause of N 300ths of a second i s taken between d i s p l a y i n g each vector. The s c a l e i s set t o 0.5, the GLISP d e f a u l t . I f an #EVAL or #EVALQ command has been executed, a #BLANK command must be placed before the #DRAW command. T h i s command works w e l l with v e c t o r s generated by the GLISP TABLET f u n c t i o n . (#PP  S <X <Y>>)  The LISP e x p r e s s i o n S i s p r e t t y p r i n t e d on the d i s p l a y screen a t l o c a t i o n X,Y. I f X or Y are omitted they d e f a u l t to the upper l e f t - h a n d corner of the d i s p l a y s c r e e n . The d i s p l a y w i l l remain on the screen u n t i l the next #BLANK command. (#SH0W S <X X,Y.  <¥»)  The CONS-cell S may be  s t r u c t u r e of S i s d i s p l a y e d on the s c r e e n at a "circular S-expression. X and Y are the , ,  58  c o o r d i n a t e s o f t h e l o s e r , l e f t - h a n d corner of the f i r s t CONScell. I t a c i r c u l a r e x p r e s s i o n i s shown, p a r t o f t h e d i s p l a y may be s l i g h t l y to t h e l e f t of X (1/4 i n c h ) , and care should be taken t h a t t h i s does not extend o u t s i d e t h e camera's view. I f X or Y a r e omitted they d e f a u l t t o the upper l e f t - h a n d corner of the d i s p l a y screen. The d i s p l a y w i l l remain on t h e screen u n t i l the next #BLANK command. (#SHOWFN FNAME <X < Y » ) The CONS-cell s t r u c t u r e o f the LAMBDA—expression of t h e function FNAME i s d i s p l a y e d on the screen a t X,Y. FNAME i s d i s p l a y e d above and i n t e n s i f i e d . I f X or Y are omitted they default t o the upper l e f t - h a n d corner of the d i s p l a y s c r e e n . The d i s p l a y w i l l remain on the screen until the next # BLANK command. (#PLOT) The contents o f the d i s p l a y screen are saved on f i l e -PLOT#. Any number of p l o t s may be saved i n t h i s manner, and they may be p l o t t e d after l e a v i n g LISP by e n t e r i n g t h e MTS command; $BUN PLOT:Q PAR= BE SURE TO ENTER ONE BLANK AFTER "PAR= «. (#RATE RATE) The r a t e at which e v a l u a t i o n animation proceeds i s s c a l e d by RATE. The normal value i s 1.0, and higher values produce faster animation. The elapsed time is not precisely p r o p o r t i o n a l to the r a t e , due t o the f i x e d overhead o f CPU time. (For example, an animation of 56.0 seconds d u r a t i o n a t (#RATE 1.0) took 30.6 seconds at (#RATE 2.0).) RATE must be g r e a t e r than zero. The #START command r e s e t s the r a t e t o 1.0. #RATE may be used within a breakpoint. See S e c t i o n 3 f o r a d e s c r i p t i o n of t h e RATE button. (#GRID) This draws a g r i d of 1-by-1 u n i t squares on the p o r t i o n o f the screen seen by the camera. T h i s i s u s e f u l when l a y i n g out hand coded d i s p l a y s . The screen i s not blanked, and t h e r e f o r e #GRID may be used before or a f t e r c r e a t i n g other d i s p l a y s on the screen. (#F0CUS) T h i s blanks the screen ( e x a c t l y as #BLANK does) and then brings up a d i s p l a y which o u t l i n e s t h e camera frame area of the d i s p l a y screen and i n d i c a t e s the c e n t e r o f the frame. This i s  59  used to frame and focus the camera. The camera should be adjusted so t h a t t h e frame o u t l i n e on the screen i s j u s t c l e a r l y v i s i b l e i n the camera viewfinder., Press the STEP button (13) t o terminate the d i s p l a y and continue with t h e next command i n t h e script. (#REDISP ATOM  •.  ATOHn)  This command may be used e i t h e r i n the s c r i p t or i n a breakpoint. I t assures that the atoms named a r e d i s p l a y e d correctly i f they are c u r r e n t l y being d i s p l a y e d by a #DISPLAY command. I t i s designed to be used a f t e r NCONC, RPLACA, or RPLACD, s i n c e they can change atomic values without e x p l i c i t l y naming the atoms. (tAIIAS FNAME ALIAS) I f t h i s command has been given, whenever f u n c t i o n FNAME i s displayed on the screen, during animation, #SHOSFN, #STAR or #DEFON, the name ALIAS i s used i n place o f the f u n c t i o n ' s real name. This i s u s e f u l when, f o r animation purposes, one wishes to r e d e f i n e a system f u n c t i o n , but t h e r e d e f i n i t i o n would disturb the o p e r a t i o n of ANTICS. For example to animate EVAL one c o u l d d e f i n e a f u n c t i o n $EVAL and i n c l u d e the command (lALIAS 3EVAL EVAL). To remove the ALIAS from a f u n c t i o n , use the command (iALIAS FNAME NIL). The c a l l t o the f u n c t i o n from tEVALS o r #EVALQ must use the f u n c t i o n ' s r e a l name, not i t s a l i a s . #STAR, tSHOWPN, #BRIEF, #EXCLUDE e t c . a l s o must use the t h e f u n c t i o n ' s r e a l name. There i s no corresponding f u n c t i o n f o r atoms s i n c e t h e a r e kept on the ANTICS EVAL a - l i s t and are completely independent from LISP/MTS. (#DISP p r i m i t i v e .  .  . primitive)  #DISP i s used t o i n c l u d e p r i m i t i v e d i s p l a y commands i n the script. The d i s p l a y w i l l remain on t h e screen until the next #BLANK command unless the FOR or FADE p r i m i t i v e s a r e used. (#EXIT-DISP SECONDS p r i m i t i v e .  .  . primitive)  This command i s used only, t o i n c l u d e p r i m i t i v e s i n t h e EXIT-FORM p o r t i o n of an animation breakpoint. The p r i m i t i v e s are d i s p l a y e d f o r the given number of seconds while the r e s t of animation waits. See S e c t i o n 6.2 f o r more i n f o r m a t i o n . ( #CAMERA {ON,OFF}) T h i s t u r n s the camera on or o f f by s w i t c h i n g connected t o l i g h t 1 on the Adage d i s p l a y s c r e e n .  the  relay  60  (#DEPTH N) T h i s command s e t s the maximum number of l e v e l s o f r e c u r s i o n of ANTICS EVAL t h a t will be d i s p l a y e d on the screen d u r i n g animation. (The maximum number o f EVAL b l o c k s d i s p l a y e d w i l l be N.) when t h i s l i m i t i s exceeded, t h r e e dots a r e d i s p l a y e d on t h e screen to i n d i c a t e t h a t part of the e v a l u a t i o n i s not being animated (though the e v a l u a t i o n does continue.) I f a breakpoint s e t s DISP? = T then animation w i l l c o n t i n u e . (#BRIEF FNAME1 . (#BRIEF)~  .  .  FNAMEn)  The f i r s t form o f t h i s command adds the named f u n c t i o n s t o a list of f u n c t i o n s which w i l l be animated as though they were SUBBs: the f u n c t i o n call and e v a l u a t i o n of parameters a r e animated, but the animation of the f u n c t i o n ' s LAMBDA-expression is made completely invisible. The commands (#BRIEF) and (#START) r e s e t the e f f e c t o f a l l previous {#BRIEF . . .) commands. (#EXCLUDE (#EXC1UDE (#EXCLUDE (#EXCLUDE  FUNCTION FNAJ1E1 ATOM AT0M1 . . FUNCTION) ATOM)  • FNAMEn) ATOMn)  The f i r s t two forms of #EXCL0DE add the s p e c i f i e d f u n c t i o n s or atoms t o r e s p e c t i v e lists which t e l l the animation to completely omit the animation of the e v a l u a t i o n o f the given f u n c t i o n s and atoms. Both EXPRs and SUBRs may be excluded. The second two forms of #EXCLUDE r e s e t the e f f e c t s of a l l previous #EXCLUDE commands. #START a l s o r e s e t s a l l iEXCLUDEd f u n c t i o n s and atoms. (tSTEPMODE) (tSTEPMODE {ON,OFF}) on.  T h i s t u r n s STEPMODE on or o f f . (tSTEPMODE) turns See S e c t i o n 3 f o r more i n f o r m a t i o n .  STEPMODE  10. GRAPHICS PRIMITIVES Graphics p r i m i t i v e s may be used i n breakpoints or within #DISP or SUBROUTINE commands i n the script. For more information see S e c t i o n 6. Notation i s explained at t h e beginning of S e c t i o n 9.  61  {•GOTO X Y) T h i s moves the d i s p l a y beam t o p o s i t i o n X,Y on without drawing.  the  screen  (*PLOT X Y) T h i s draws a v e c t o r from the present to X,Y.  p o s i t i o n on the screen  (•SYMBOL X Y STRING HEIGHT) The c h a r a c t e r s of STRING are d i s p l a y e d on the s c r e e n . X,Y i s the l o c a t i o n of the lower left-hand corner of the f i r s t character of STRING, and HEIGHT i s the height of the c h a r a c t e r . (The v a r i a b l e TXTHT may be used f o r HEIGHT. This will give characters the same s i z e t h a t ANTICS normally uses.) The horizontal spacing of c h a r a c t e r s i s 6/7 (0.857) times a character's height. (FOR  SECONDS p r i m i t i v e . . .  primitive)  The p r i m i t i v e s are d i s p l a y e d f o r the given number o f seconds and then turned o f f . Note t h a t i n GLISP the FOR f u n c t i o n takes t h e time parameter i n i n frames, not seconds. (FADE HOLDTIME FADETIME p r i m i t i v e .  .  . primitive)  The p r i m i t i v e s a r e d i s p l a y e d f o r HOLDTIME seconds at normal i n t e n s i t y and then fade out g r a d u a l l y i n FADETIME seconds. (*DASH) (*UNDASH) Vectors drawn a f t e r (*DASH) are drawn as dashed l i n e s (•UNDASH) i s encountered.  until  (•INTENSITY N) N i s a number between 0.0 and 1.0 c o n t r o l l i n g the i n t e n s i t y of the f o l l o w i n g v e c t o r s . Two v a r i a b l e s , NORMAL and BRIGHT, a r e available as standard i n t e n s i t y values ( t h e i r values a r e 0.55 and 0.77 r e s p e c t i v e l y . ) ANTICS does not r e s e t the i n t e n s i t y i f it i s changed by the user — she must be sure t o r e s e t i t t o NORMAL.,  62  (GPRQG (IABEX#primitive} .  .  .  {LABEL,primitive})  T h i s i s a PROG type f u n c t i o n taken from GLISP. I t i s used i n c o n j u n c t i o n with *JUMP. See the GLISP documentation £ 1 1 ] f o r more i n f o r m a t i o n . (*JUMP LABEL) (*SKIPNZ COUNT) (*SKIPZ COUNT) These a r e used i n c o n j u n c t i o n with GPSOG. documentation £ 1 1 ] f o r more i n f o r m a t i o n . (ADJ  (DX DY INTENSITY SCALE) p r i m i t i v e .  .  See the GLISP  . primitive)  T h i s i s provided p r i m a r i l y f o r GLISP c o m p a t i b i l i t y . The p r i m i t i v e s a r e d i s p l a y e d a t the given i n t e n s i t y , s c a l e , and offsets. U n l i k e GLISP, d i a l s may not be s p e c i f i e d . I f . an ADJ primitive i s nested i n s i d e a FADE p r i m i t i v e , the ADJ i n t e n s i t y i s ignored. The a d j u s t i n g values a r e i n the range of -10.0 t o 10.0. (SHW1 S X Y) This p r i m i t i v e i s the same as the #SHOi command, except that X and Y are r e g u i r e d . (PPD FORM X Y WIDTH LEVELS LINE-SKIP) T h i s p r e t t y p r i n t s FORM on the d i s p l a y s c r e e n . The bottom left-hand corner of the f i r s t c h a r a c t e r i s l o c a t e d a t X,Y. WIDTH s p e c i f i e s the maximum width o f the screen, i n c h a r a c t e r s , that will be used. LEVELS s p e c i f i e s t h e depth t o which FORM w i l l be p r i n t e d i n d e t a i l . Sub-expressions of FORM beyond this l e v e l w i l l be r e p l a c e d by "6". LINE-SKIP s p e c i f i e s the d i s t a n c e between successive lines on t h e s c r e e n . I f LINE-SKIP i s zero only one l i n e w i l l be p r i n t e d , and i f any l i n e s a r e skipped as a r e s u l t , three dots w i l l be p r i n t e d as an i n d i c a t i o n . The height of the c h a r a c t e r s used i s determined by the g l o b a l v a r i a b l e TXTHT. The g l o b a l v a r i a b l e SCREEN-WIDTH i s s e t t o the width of t h e screen i n c h a r a c t e r s , and i t may be used f o r WIDTH. TXTHT*2 i s set to a good value f o r LINE-SKIP. The g l o b a l v a r i a b l e SHORTQUOTE c o n t r o l s t h e p r i n t i n g o f t h e QUOTE f u n c t i o n . I f SHORTQUOTE = T then a l l QUOTE f u n c t i o n s w i l l be a b b r e v i a t e d with «»«.  63  Hi.  USEFUL ANTICS VARIABLES  The f o l l o w i n g t a b l e l i s t s ANTICS v a r i a b l e s which the user may wish to access or change. They may be changed e i t h e r i n the script o r i n b r e a k p o i n t s during animation. The type of numeric variables, integer or r e a l , should not. be changed. If a variable i s indicated to have dependants then t h e r e are other ANTICS variables which are c a l c u l a t e d from the p a r t i c u l a r variable. After changing any of these v a r i a b l e s and before e x e c u t i n g any ANTICS commands o r l e a v i n g a b r e a k p o i n t , the function INITL-CALC should be c a l l e d to r e - c a l c u l a t e the dependant v a r i a b l e s . (INITL-CALC takes no parameters.)  64  r  1 VARIABLE i NAME  i  BRIGHT NORMAL GLISP-SCALE FOLLOW? REFS? ROLL-RATE FOLLOW-RATE MOVE-RATE ENTER-WAIT EXIT-WAIT DEFON-WAIT SHORT-WAIT MEDIUM-WAIT DOWN-Y RIGHT-X B0X8 ARRL BARBSIZE BOXH EV—* EV-HT TXTHT SCREEN-LIMIT ROLL-RATIO VALUE-LENGTH EVAL-PPLEV VAR-PPLEV STAR-PPLEV FRAME-RATIO DONT-TOUCH #DEPTH "*UNDEF* FRAMES/SEC RETURNS? EVLIS? EVLIS-MOVE? EVLIS-PPLEN SHORTQUOTE LOOPS? CONTINUE? SHOWNIL? DETAILATOM? CONSIZE ATMHT YD EC MINCONSWIDTH X-LIMIT Y-LIMIT ALIST?  T—  -  | DEFAULT J VALDE  —_ j  .T  T r~ I SETQ?|DEPEN-| NOTE | WHERE |DENTS J RESET  i  i 1  -  i  | . 77 | .55 1 .5 1 T | NIL 1 .75 | 2. | .75 I 2.  1 NO  \ NO | YES 1 YES | YES | YES | YES | YES J YES | YES 1 1| YES i 2. | YES I .4 | YES I -8 | .6 | YES I 1j YES | YES I .5 | .2 | YES | YES j .075 I -2 1 YES | .05 | YES | YES I .1 J YES I .14 | NO I 5. | .66 | YES | 24 | YES f YES I 4 | YES I 2 ) 100 | YES | .74 | YES | YES I -1 | 10000 | YES | "*UNDEF* " J YES I 40. 1 YES | YES I T | YES I T | YES I T I 8 I YES | YES J T | YES i T | YES J T | NIL | YES J YES I NIL | .16 | YES | YES I .11 I -.5 I YES | .55 | YES | 4.5 | YES | -4.5 | YES ] NIL | YES i  .  J  ,  I 1 1 I 1 1 1 1 1 1 1 1 1 1 1  ~ ~  |  I 1  |  1 1 |  1 I  |  1 1 i |  I  |  1 1 1 |  1 1 1 J 1 1 1 |  1  |  1 I 1 1  -i.  -  i \  1 1 t 1 i  NO NO | 2 NO | 2 NO | 3 NO | 3 NO | 3 NO | 3 NO | 3 NO | 3 NO i 3 NO | 3 NO 1 4 NO | 4 YES | YES J 4 NO | 4 YES | 4 NO ] ^ NO | 4 YES | 5 1 6 NO | 7 YES | 3 NO i 9 NO | 9 NO | 9 YES j 10 NO | 11 NO | 12 NO | 13 NO | 14 NO | 15 NO J 15 NO | 15 NO 1 16 NO | 17 NO | 18 NO | 18 NO | 18 NO | 18 YES J 19 NO | 19 NO j 19 NO | 19 NO ) 20 NO | 20 NO { 21 J.  i T  ]  I j I I I #START,#RATE  | #ST.ART,#RATE I #START #RATE I iSTART,#RATE | #START,#RATE i fSTART I #START,#RATE j #START,#RATE #  I I  !  1 1  |  t 1 1  |  f I 1 1 1  | | | | | | | |  |  #START tSTAfiT #START #START  | #START |  J  | | |  J  | |  J  | | i.  J  65  NOTES: 1. 2.  3.  See the p r i m i t i v e *.INTENSITY, FOLLOW? i s used t o t u r n the f o l l o w e r on or o f f . REFS? determines whether the f o l l o w e r w i l l move to the v a r i a b l e d i s p l a y when atomic values are r e f e r e n c e d . These c o n t r o l the r a t e a t which animation progresses. MOVERATE, FOLLOW-RATE and ROLL-EATE c o n t r o l the r a t e s of movement o f r e t u r n values, the f o l l o w e r and r o l l i n g o f the display. They a r e i n u n i t s of s c r e e n - u n i t s / s e c o n d . ENTER-WAIT and EXIT-WAIT c o n t r o l the time delays before and a f t e r e n t e r i n g animation EVAL. SHORT—WAIT and MEDIUM-WAIT c o n t r o l time delays which occur a t various t i m e s during animation, DEFUN-WAIT determines the time delay i n #DEFUN between p r e t t y p r i n t i n g t h e f u n c t i o n and d i s p l a y i n g i t s CONS-cells. These v a r i a b l e s determine the dimensions of t h e EVAL box d i s p l a y during animation. The f o l l o w i n g f i g u r e i l l u s t r a t e s t h e i r s i g n i f i c a n c e . These v a r i a b l e s should not be changed during animation. I  BY-*  W—•  ,  I IL_I  It  ^  EVBL  LEQURL  THIN. » tCRR  Figure  5. 6. 7. 8.  9.  4 - Dimensions of an EVAL Box (actual size)  TXTHT i s t h e h e i ght of a l l t e x t used i n ANTICS except f o r atom names i n SHOW SCREEN-LIMIT i s the bound f o r the a b s o l u t e v a l u e s o f X and Y coordinates. I t i s provided f o r reference, and probably s h o u l d not be chan ged. ROLL-RATIO datermi nes the f ra c t i o n o f the screen which w i l l disappear when a n i mation r o l Is p a r t of the d i s p l a y upwards o f f the s c r e e n . VALUE-LENGTH i s the approxiraa te maximum number o f c h a r a c t e r s which will be d i s p l a y e d as r e t u r n values or e n t r i e s i n # DISPLAY o r #STACK d i s p l a y s , The a c t u a l length displayed depends on the n umber o f v e c t o r s r e q u i r e d to generate the characters. EVAL-PPLEV i s the number o f l e v e l s of d e t a i l that are shown  66  10. 11. 12. 13. 14. 15.  16. 17. 18.  19.  when p r e t t y p r i n t i n g forms being evaluated during animation. VAR-PPLEV i s the number o f l e v e l s of d e t a i l i n c l u d e d d u r i n g animation when p r i n t i n g r e t u r n values o r e n t r i e s i n t h e #DISPLAY or #STACK d i s p l a y s . STAR-PPLEV i s the number o f l e v e l s o f d e t a i l i n c l u d e d when p r e t t y p r i n t i n g f o r the #ST AR or #PP commands. This i s the r a t i o frame-height/frame-width o f the camera being used. 0.74 i s c o r r e c t f o r Super-8 mm. f i l m . DONT-T00"CH i s simply a s h o r t d i s t a n c e on the screen which may be used when two p a r t s of a d i s p l a y would look best i f they were very c l o s e but not t o u c h i n g . #DEPTH c o n t r o l s the depth o f e v a l u a t i o n . See the command #DEPTH f o r more i n f o r m a t i o n . T h i s i s the v a l u e given t o undefined atoms. N o t i c e the blank added t o t h e name which d i s t i n g u i s h e s t h i s from the LISP/aTS undefined atom value. FRAMES/SEC s h o u l d match the r e f r e s h r a t e of the Adage It i s used when producing movement and i n t h e FADE and FOR primitives. RETURNS? determines whether r e t u r n values w i l l be d i s p l a y e d or not. EVLIS? determines whether values from the evaluation of arguments w i l l be d i s p l a y e d ; and EVLISMOVE? determines whether they w i l l be moved i n t o a l i s t of argument v a l u e s . This i s t h e maximum l e n g t h , i n c h a r a c t e r s , of t h e EVLIS v a l u e s t h a t are l i s t e d . I f SHORTQUOTE = T, (QUOTE S) w i l l be a b b r e v i a t e d 'S whenever i t i s displayed. These affect SSHOw, tSHOMFN, #DEFUN, and SHS1. LOOPS? determines whether a s e a r c h will be made f o r c i r c u l a r S-expressions. I f CONTINUE? = T, p o r t i o n s of the d i s p l a y which w i l l not f i t on t h e screen a r e p r e t t y p r i n t e d . (Also see Note 20 below.) I f SHOHNIL? = T, a l l NIL atoms are shown, i n c l u d i n g those which are CDRs. I f DETAILATOM? = T, a l l atoms a r e shown t o be CONS-cells with t h e i r PNAMEs d i s p l a y e d t o the r i g h t . These a r e t h e dimensions used when d i s p l a y i n g CONS-cell structures:  3 [  ST CONO. .1  —JNULL ;Lisr"*™*r  F i g u r e 5 - Dimensions of a CONS-cell (actual size)  67  20. These a r e t h e l i m i t s of t h e screen while d i s p l a y i n g CONSc e l l structures. When the d i s p l a y attempts t o go t o the r i g h t of or below these l i m i t s , i t w i l l s t o p , and depending on the value o f CONTINUE?, t h e remainder w i l l be prettyprinted. (See Note 18 above.) 21. See the command #STACK.  INDEX TO ANTICS USEfi^S GUIDE ADJ ... ........................... 62 #ALIAS ..............................59 # BLANK .............................. 56 #BRIEF ..............................60 B u t t o n s ..........................42-43 •CAMERA ......a,.,..,...,,,.....,..,.59 * D A S H ............................... 61 #DEFUN 45,55 #DEPTH ..............................60 • DISP ,.,..-,.46,59 •DISPLAY .........................40,55 • DRAW ., .57 #END ...... ........... ......57 #EVAL ..... ..................40,56 #EVALQ .... ..................40,56 #EXCLUDE .. ........ ..60 •EXIT-DISP ..47,59 FADE ...... 61 tFOCUS .... 58 FOB ....... ...,...,.,..,,.......61 *GOTO ..... .,,.......,...,..,...,....61 GPBOG ............................,,.62 • GRID ...............................58 •INTENSITY ..........................61 *JUMP 62 L i g h t Pen .................. ....,42 N o t a t i o n ...............,.....,,,...,54 #PLOT 58,61 #PP 57 PPD , 62 • RATE .................,,,,....,.,43,58 #REDISP .......,,...,,,,...,,.,,.,,..59 •SET 57 #SETQ .57 •SHOW 45,57 •SHOWFN ., 58 SHH1 ..............,..,,.......-..,-,62 •SKIPNZ .62 • SKIPZ 62 •STACK .40,56 • STAB 40,55 #STABT .............................. 54 • STEPMODE 60 SUBROUTINE ....................... 49,57 •SYMBOL .............................61 • UNDASH ...61 V a r i a b l e s ...........................63 #8AIT .......................,...,42,56  69  APPENDIX B - SAMPLE ANTICS SCRIPTS T h i s s c r i p t produced the animated f i l m which i s i n c l u d e d as part of t h i s t h e s i s . It lasts approximately three minutes, twenty seconds, but f o r e d u c a t i o n a l purposes i t probably should be slowed down by a f a c t o r of two or t h r e e . (PROGN (SETQ FRAMES/SEC 30) (#F0CUS) (tWAIT 10.) (#START) (#CAMERA ON) ;TITLES (#DISP (FADE 6. 2. (•SYMBOL -2.57 1. 'MEMBER 1-))) (#HAIT 2.) (#DISP (FADE 4. 2. (•SYMBOL -1.8 0. '"BY MARK DIONNE" .3))) (#WAIT 6.5) (#DISP (FADE 5. 2. (•SYMBOL -3. 2.5 *"SUBMITTED IN PARTIAL FULFILLMENT OP" .2) (•SYMBOL -2.92 2. 0 '"THE REQUIREMENTS FOR THE DEGREE OF" .2) (•SYMBOL -1.46 1.5 '"MASTER OF SCIENCE" .2) (•SYMBOL -2.57 0. »"UNIVERSITY OF BRITISH COLUMBIA" .2) (•SYMBOL -1.11 -.5 '"OCTOBER, 1975" .2))) (#WAIT 7.) (#BLANK) (#RATE .9) (SETQ X-LIMIT 5.0) (#DEFUN MEMBER (THING LIST) (COND {{NULL LIST) NIL) { (EQUAL THING (CAR LIST)) LIST) {T (MEMBER THING (CDR L I S T ) ) ) ) ) (#WAIT 6.) (SBLANK) (ISTAR MEMBER) (#DISPLAY THING LIST) (#STACK THING LIST) EVALUATION ANIMATION (#EVALQ (MEMBER ' A ' (C A T) )•) (#WAIT 2.) (#BLANK) ;"THE END" (tDRAM 0 {•GOTO 0 0) (•GOTO -8.351988 -0.083084) {•PLOT -8.151501 -0.183328) (Approximately 100 l i n e s of •PLOT and •GOTO p r i m i t i v e s are omitted a t t h i s p o i n t . They were generated by GLISP using the data t a b l e t and c o n s t i t u t e the words "the end" i n hand drawn s c r i p t . )  (#END) )  (•PLOT 5.701635 -1.694323) (•PLOT 5. 853224 -1. 542734))  70  This script i l l u s t r a t e s the d i s p l a y o f S-expressions, F i g u r e 1 (page 9) shows the screen a f t e r t h i s script has been executed. (PROGN {# BLANK) (#DISP (*SYMBOL -5. 4.5 «"1 - (SETQ Z «((&) B) ) (SETQ Z » ( (A) B) ) (#HAIT 1.) (#DISP (*SYHBOL -4.5 4. , • Z= TXTHT)) (#SH0W Z -4.5  3.5)  TXTHT) )  (#WAIT 5.) (#DISP (*SYMB0L -5. 1. »"2 - (RPLACD (CDR 2) Z) " TXTHT)) (NULL (RPLACD (CDR Z) Z)) (#WAIT 1.) (#DISP (*SYMBOL —4.5 .3 *Z= TXTHT)) (#SHOB Z -4.5 -0.2) (#WAIT 5.) (#DISP (*SYBBOL 0. 4.5 »"3 - (RPLACA (CDR Z) (CAR Z) ) " TXTHT) ) (NULL (RPLACA (CDR Z) (CAR Z) ) ) (#8AIT 1.) (#DISP (*SYMBOL 0.5 4.0 «Z= TXTHT)) (#SHO» Z 0.5 3.5) (#WAIT 5.) (#DISP (*SYHBOL 0. 1. »"4 - (RPLACD Z Z ) " TXTHT)) (NULL (RPLACD Z Z)) (#DISP (*SYMBOL .5 .3 • Z= TXTHT) ) (#SHOS Z 0.5 -.2) (tWAIT 5.) )  71  T h i s s c r i p t animates the execution of a s i m p l i f i e d v e r s i o n of EVAL. I t uses s e v e r a l of the more advanced f e a t u r e s of ANTICS to d e l e t e unnecessary d e t a i l from the f i l m and t o permit the animation of f u n c t i o n s with the same names as LISP system functions. The *APPLY f u n c t i o n uses user breakpoints i n a novel way t o access the LISP/MTS APPLY f u n c t i o n i n order t o execute SUBRs. Since the functions,animated here are t o o l a r g e t o f i t on the d i s p l a y screen e a s i l y , t h e viewer should be provided with a copy of EVAL f o r r e f e r e n c e £ 1 6 ] , (PROGN (#START) (#DISPLAY FORM FN A ARGS) (tSTACK FORM A) ;THE EVAL FUNCTIONS ARE PRINTED AS SKELETONS — (SETQ EVAL-PPLEV 2) (tEXCLUDE FUNCTION  QUOTE CAR CDR  THEY ARE LARGE  NULL)  (tEXCLUDE ATOM FORM FN A EXP ARGS C M NIL T J) (#BRIEF !GET SASSOC APPLY* *PAIR) (#ALIAS !GET GET) ;*PAIR IS PART OF ANTICS! (#ALIAS *PAIR PAIR) (#ALIAS ! EVAL EVAL) (#ALIAS !EVCON EVCON) (#ALIAS .'EVLIS EVLIS) (#ALIAS !APPLY APPLY) (#SETQ A • { (T . T))) (DEFUN !APPLY (FN ARGS A) (COND ( (NULL FN) NIL) ((ATOM FN) (COND ( (!GET FN • EXPS) {! APPLY EXP ARGS A)) ((!GET FN * SUBR) (APPLY* EXP ARGS)) (T {!APPLY (SASSOC FN A) ARGS A ) ) ) ) ( (EQ (CAR FN) ' LAMBDA) (I EVAL (CADDR FN) (NCONC (*PAIR (CADR FN) ARGS) A))) (T (IAPPLY (I EVAL FN A) ARGS A)))) (DEFUN J EVAL (FORM A) (COND {(NULL FORM) NIL) ( (NUMBERP FORM) FORM)  ( (ATOM FORM) (SASSOC FORM A)) ( (EQ (CAR FORM) 'QUOTE) (CADE FORM) ) ( (EQ (CAR FORM) 'COND) (IEVCON (CDR FORM) A)) { (ATOM (CAR FORM)) (COND {('GET (CAR FORM) 'EXPR) ('APPLY EXP (IEVLIS (CDR FORM) A) A) ) ( (! GET (CAR FORM) *SUBR) (APPLY* (CAR FORM) {!EVLIS (CDR FORM) A))) (T {! EVAL (CONS (SASSOC (CAR FORM) A) (CDS FORM)) A) ) ) ) (T (! APPLY (CAR FORM) (!EVLIS (CDR FORM) A) A ) ) ) ) (DEFUN JEVCON (C A) (COND { (! EVAL (CAAR C) A) (! EVAL (T (IEVCON (CDR C) A) ) ) )  (CADAR C) A))  (DEFUN ! EVLIS (M A) (# (AND DISP? (SETQ DISP? (LESSP #TIMES 2))) (COND ( (NULL M) NIL) (T (CONS (! EVAL (CAR M) A) (! EVLIS (CDR M) A ) ) ) ) ) ) {DEFUN !GET (FN TYPE) (SETQ EXP (GET FN TYPE) ) (COND ((NULL EXP) NIL) ((EQ TYPE 'SUBR) »*) (EXP))) (DEFUN SASSOC (AT LIST) (CDR (ASSOC AT LIST " (*UNDEFINED*) ) )) (DEFUN APPLY* (EXP ARGS) (# (APPLY (*VALUE •EXP A NIL) (*VALUE 'ARGS A NIL)))) ) ;AN EXAMPLE (DEFUN FOO (X) (CONS X X ) ) (#EVALQ  (J EVAL ' {FOO »Z)  A))  APPENDIX C - ANTICS PROGRAM LISTING  .******************* ;  LISPBASIC  • *******************  (STATUS  (32 6))  (MTS *"SET LIBSRCH=GRAF:AGTBASIC+AGT:BASIC") ;PARTS OF LISPBASIC WHICH ARE NOT USED ARE OMITTED (DEFINE (DUMMY1 SUBR (0 "GRAF:LISPBASIC.0" AGPLOT)) (#DUMP# SUBR (3 "GRAF:BDUMP.0" BDUMP)) (GETSPACE SUBR (0 "GRAF:LISPBASIC.O" LGETSPA)) {AGTRD SUBR (0 "GRAF:LISPBASIC.0" LAGTRD)) (BUTTON SUBR (0 "GRAF:LISPBASIC.0" LBUTTON)) (DIAL SUBR (0 "GRAF:LISPBASIC.O" LDIAL)) (PENHIT SUBR (0 "GRAF:LISPBASIC.0" LPENHIT)) (INDEX SUBR (0 "GRAFMISPBASIC. 0" LINDEX) ) (AGTBUF SUBR (0 "GRAF:LISPBASIC.0" LAGTBUF)) (AGTCON SUBR (0 "GRAF:LISPBASIC.0" LAGTCON)) (CONAGT SUBR (0 "GRAF:LISPBASIC.O" LCONAGT)) (AGTCVT SUBR (0 "GRAF:LISPBASIC.0" LAGTCVT)) (AGTDSP SUBR (0 "GRAF:LISPBASIC.0" LAGTDSP)) (AGTEXT SUBR (0 "GRAF:LISPBASIC.0" LAGTEXT)) (AGPLOT SUBR (0 "GRAF:LISPBASIC0" LAGPLOT)) ) (SETQ DASH 1 UNDASH 2 SCALE-D 4 SCALE 5 DX-D 6 DX 7 DY-D 8 DY 9 INT-D 10 INT 11 PENON 15 PENOFF 16 MOVE 19 MOVER 20 JUMP 21 JUMPR 22 SKIPNZ 23 SKIPZ 24 INCR-D 25 INCR 26 LIGHTSON 34 LIGHTSOFF 36) (DEFUN BDUMP (ARRAY START END) (PROG NIL (OR (AND (GREATERP START 0) (LESSP START (ADD1 END))  \  74 (LESSP END 6001}) (RETURN (NULL (PRINT '"BAD INDEX PASSED TO BDUMP")))) (#DUMP# ARRAY START END}))  .******************** ; INITIALIZATION ETC. - ******************** ;.IFADG CHECKS TO SEE IF HE ARE AT THE ADAGE TERMINAL (DEFINE (RTHAIT SUBR (3 *LIBRARY RTWAIT)) (AGT? SUBR (0 "MASD: AGTEST.O" IFADG) ) {STOP BUG ( (LAMBDA NIL (AND PLOTTED? (PRINT '"PLOT OUTPUT IS ON FILE -PLOT#")}))>) ;FIX SYSTEM FUNCTION PLEN SO THAT IT WORKS FOR NUMERIC ATOMS (PUT »#PLEN# 'SUBR (GET * PLEN 'SUBR)) (PUT * PLEN 'EXPR « (LAMBDA (ATOM) (COND ((NUMBERP ATOM) (#PLEN# (MKATOM ATOM) ) ) ((#PLEN# ATOM)}))) ; INITIALIZE "ONE-TIME" STUFF ;THESE SHOULD GENERALLY NOT BE CHANGED BY THE USER (SETQ AT AGT? (AGT?) STAR NIL ?STEPMODE NIL PLOTTED? NIL STAR-FLAG NIL FADE? NIL SUBROUTINE? NIL EVALING? NIL ON 'ON OFF * OFF SCREEN-LIMIT 5. CAMERA? NIL TIME-FILM-STARTED NIL RESTART-CAMERA NIL USER-FORM »# STAR-FORM '* FULLMODE 2 PAREN-LEN 4 ii jn i it H j II  I H j It  II  t II  •  II  II • II  & '&  *  II  I I I I II  EVAL-COUNTER 1  RATE-BUTTON 14 QUIT-BUTTON 10 STEP-BUTTON 13 BACKUP-BUTTON 5 STEPMODE-BUTTON 15 AUTO-BUTTON 16 PLOT-BUTTON 9 BREAK-BUTTON 11 CAMERA-BUTTON 12 NORMAL-BUTTONS (LIST STEP-BUTTON QUIT-BUTTON AUTO-BUTTON STEPMODE-BUTTON PLOT-BUTTON BREAK-BUTTON RATE-BUTTON CAMERA-BUTTON) EVAL-BUTTONS (CONS BACKUP-BUTTON NORMAL-BUTTONS)) ;IF THE FOLLOWING ARE CHANGED EVERYTHING MUST BE RELOADED (SETQ LWA-ADAGE 6000 FOLLOWER-SIZE 0.1 *SCALE 1. BRIGHT 0.77 NORMAL 0.55) ;THESE MAY BE CHANGED BY THE USER (SETQ GLISP-SCALE 0.5 FOLLOW? T ALIST? NIL REFS? NIL "*UNDEF* " '"*UNDEF* « DEFUN-WAIT 2. FRAMES/SEC 40. FILM-USED 0. FILM-LENGTH NIL TIMESCALE 1. FRAME-RATIO 0.74 TXTHT 0.14 DONT-TOUCH 0.1 ITSY-BITSY 0.05 DOWN-Y 0.6 RIGHT-X 1. EVLIS-PPLEN 8 BOXW 0.5 ARRL 0.2 BARBSIZE 0.075 BOXH 0.2 EV-* 0.05 EV-HT 0. 1 ROLL-RATIO 0.66 VALUE-LENGTH 24 STAR-PPLEV 100 EVAL-PPLEV 4 VAR-PPLEV 2)  ;THESE ARE USED BY #SHOH ;CONSIZE IS THE HEIGHT OF A CONS CELL (SETQ YDEC -0.5 ATMHT 0.11 CONSIZE 0.16 SOMESPACE 0.035 SHOW-BARBSIZE 0.05 MINCONSWIDTH 0.55 X-LIMIT 4.5 Y-LIMIT -4.5 SHOWNIL? NIL DETAILATOM? NIL LOOPS? T CONTINUE? T) ;RE-CALCULATE DEPENDANT CONSTANTS (DEFUN INITL-CALC () (SETQ DY-DX-SCALE (TIMES *SCALE 0.1) LINE-SKIP (TIMES TXTHT 1.5) NEG-SCREEN-LIMIT (MINUS SCREEN-LIMIT) BOTTOM-OF-FILM (SUB SCREEN-LIMIT (TIMES FRAME-RATIO (ADD SCREEN-LIMIT SCREEN-LIMIT) )-) TXTHT*2 (ADD TXTHT TXTHT) TXTHT/2 (TIMES TXTHT 0.5) BOXW/2 (TIMES BOXW 0.5) BOXH/2 (TIMES BOXH 0.5) EVAL-BLK-HT (ADD ARRL BOXH) AGT-VALUE-LENGTH (TIMES VALUE-LENGTH 5) LOOPDEC (TIMES 0.5 (ADD YDEC CONSIZE)) CONSIZE/2 (TIMES CONSIZE 0.5) CONSIZE*2 (ADD CONSIZE CONSIZE) VARS-X (SUB SCREEN-LIMIT (TIMES VALUE-LENGTH TXTHT)) STACK-X VARS-X SCREEN-WIDTH (FIX (DIVIDE (SUB SCREEN-LI MIT N EG-S CRE EN-LIMIT) TXTHT)))) (INITL-CALC) ;SET SPEED OF ANIMATION (DEFUN #RATE (N) (SETQ ENTER-WAIT (DIVIDE 2. N) EXIT-WAIT (DIVIDE 1. N) MOVE-RATE (TIMES 0.75 (MAX (FLOAT N) 1.)) ROLL-RATE (MIN 4 0. (TIMES 0.75 (MAX (FLOAT N) 1.))) FOLLOW—RATE (TIMES 2. (MAX (FLOAT N) 1.)) SHORT-WAIT (DIVIDE 0.4 N) MEDIUM-WAIT (DIVIDE 0.8 N) ) )  77  ;SET UP AGT ARRAYS ; (ALIST-LPAREN, ABOUT LINE — 6 5 , IS SPACE FOR THE ALIST OUTER . „ (COND (ATAGT? (SETQ :ARRAY (GETSPACE LWA-ADAGE) tFQLLOW (GETSPACE 15) : ROLL (GETSPACE 8) ICONTROL (GETSPACE 124) ROLL-LEN 7 ROLL-EOL 8 :EOL (GETSPACE 1) ;NOP (GETSPACE 1) :TEMP (GETSPACE 10) :BRIGHT (GETSPACE 1) :NORMAL (GETSPACE 1) :STACK (GETSPACE 1) :SKIP-VAL (GETSPACE 1)) (INDEX : ROLL 1) (SETQ ROLL-SKIP (INDEX :ROLL)) (AGTCON SKIPZ 0 0 ;ROLL) (SETQ ROLL-INCR (INDEX :ROLL)) (AGTCON INCR 0 0 :ROLL) (SETQ ROLL-DY (INDEX :ROLL)) (AGTCON DY 0 0 :ROLL) (AGTCON INT 0 NORMAL :ROLL) (AGTCON DX 0 0 :ROLL) (AGTCON PENON 0 0 :ROLL) (SETQ ROLL-JUMP (INDEX :ROLL)) (AGTCVT 0 0 NIL NIL ;ROLL) (AGTCVT 0 0 NIL T :ROLL) (AGTCON INT 0 BRIGHT :BRIGHT 1) ' (AGTCON INT 0 NORMAL :NORMAL 1) (AGTCON SKIPZ 0 0 :FOLLOW 2) (AGTCON INCR 0 0 :FOLLOW) (AGTCON DX 0 0 :FOLLOW) (AGTCON SKIPZ 0 0 :FOLLOW) (AGTCON INCR 0 0 :FOLLOW) (AGTCON DY 0 0 :FOLLOW) (AGTCVT 0. FOLLOWER-SIZE NIL NIL :FOLLOW) (AGTCVT (TIMES 0.6 FOLLOWER-SIZE) (TIMES -0.8 FOLLOWER-SIZE) T NIL :FOLLOW) (AGTCVT (TIMES -0.95 FOLLOWER-SIZE) (TIMES 0.3 FOLLOWER-SIZE) T NIL : FOLLOW) (AGTCVT (TIMES 0.95 FOLLOWER-SIZE) (TIMES 0.3 FOLLOWER-SIZE) T ( H )  NIL :FOLLOW) (AGTCVT (TIMES -0.6 FOLLOWER-SIZE) (TIMES -0.8 FOLLOWER-SIZE) T NIL :FOLLOW) (AGTCVT.0. FOLLOWER-SIZE T NIL :FOLLOW) (SETQ FOLLOW-LENGTH (SUB1 (INDEX :FOLLOW) ) ) (AGTCON JUMPR FOLLOW-LENGTH 0 :FOLLOW 1) (AGTCON SCALE 0 *SCALE :CONTROL 1) (SETQ CAMERA-CONTROL (INDEX :CONTROL)) (AGTCON LIGHTSOFF 1 0 :CONTROL) (AGTCON PENOFF 0 0 :CONTROL) (AGTEXT -0.72 -4. 0.28 'ANTICS :CONTROL) (INDEX : CONTROL (ADD1 (SETQ STEP-CONTROL (INDEX : CONTROL) ) )•) (AGTCON PENON 0 0 :CONTROL) (SETQ INTS-STEP (INDEX :CONTROL)) (AGTCON INT 0 NORMAL :CONTROL) (AGTEXT NEG—SCREEN-LIMIT NEG-SCREEN-LIMIT TXTHT 'STEP :CONTROL) (AGTCON INT 0 NORMAL :CONTROL) (SETQ END-STEP (INDEX :CONTROL)) (AGTEXT (ADD NEG-SCREEN-LIMIT (TIMES TXTHT 6) ) NEG-SCREEN—LIMIT TXTHT •AUTO ;CONTROL) (AGTCON PENOFF 0 0 :CONTROL) (SETQ END-AUTO (INDEX :CONTROL)) (INDEX :CONTROL (ADD 1 END-AUTO)) (SETQ EVAL-RETURN (INDEX :CONTROL) STACK-ROLL-ADDR EVAL-RETURN) (AGTCON SKIPZ 0 0 :CONTROL) (AGTCON INCR 0 0 :CONTROL) (AGTCON DY 0 0 :CONTROL) (AGTCON PENOFF 0 0 :CONTROL) (SETQ ALIST-LPAREN (INDEX :CONTROL)) (REPEAT '(AGTCVT 0 0 NIL NIL 2 CONTROL) PAREN-LEN) (SETQ STACK-JUMP (INDEX :CONTROL)) (AGTCON JUMP LWA-ADAGE 0 :CONTROL) (SETQ CONTROL-LEN (INDEX : CONTROL) INIT-FREE CONTROL-LEN) (AGTCVT 0 0 NIL T :CONTROL) (AGTCON JUMP INIT-FREE 0 :CONTROL STEP-CONTROL) (AGTCON JUMP  (AGTCON {AGTCON  (AGTCVT (AGTCVT  INIT-PREE 0 :CONTROL END-ADTO) JUMP EVAL-RETURN 0 :STACK JUMPR AGT-VALUE-LENGTH 0 ;SKIP-VAL D 0 0 NIL NIL :NOP 1) 0 0 NIL T :EOL 1) ) )  .***************************  ; FUNCTIONS CALLED BY A USER .*************************** ;SET ANIMATION VARIABLES (DEFUN #SETQ FEXPR (Q) (COND ((LISTP (CAR Q) ) (ERRMSG ATTEMPT TO SETQ: ({CAR Q) ) ) ) { (NULL (CDDR Q) ) (•SETQ1 (CAR Q) (EVAL (CADR Q)) (COND (EVALING? A) (•ALIST) ) ) ) (T {•SETQ1 (CAR Q) (EVAL (CADR Q) ) (COND (EVALING? A) (•ALIST))) (APPLY «#SETQ (CDDR Q))))) (DEFUN #SET FEXPR (Q) (PROG (AT) (SETQ AT (EVAL (CAR Q))) (COND ( (LISTP AT) (ERRMSG ATTEMPT TO SET: (AT))) { {NULL (CDDR Q)) (•SETQ1 AT (EVAL (CADR Q) ) (COND (EVALING? A) (•ALIST)))) (T (•SETQ1 AT (EVAL (CADR Q) ) (COND (EVALING? A) (•ALIST))) (APPLY «#SET (CDDR Q) ) ) ) ) ) ;DEFINE AND DISPLAY A FUNCTION (DEFUN #DEFUN FEXPR (F) (PROG (NLINES) (APPLY * DEFUN F) (INDEX : ARRAY 1) (SETQ NLINES (FIX (PPD (CONS * DEFUN F) NEG-SCREEN-LIMIT  (SOB SCREEN-LIMIT TXTHT) SCREEN-WIDTH 100 TXTHT*2) ) )  (DISPL) (#WATT DEFUN-W AIT) (APPLY1 •#SHOWFN (CAR F) NEG-SCREEN-LIMIT (SOB SCREEN-LIMIT (TIMES TXTHT*2 (ADD 2 NLINES)))))) ;PRETTYPRINT AN S-EXPRESSION AT X Y ON THE SCREEN (DEFDN #PP N (INDEX : ARRAY 1) (PROG (X) (PPD (ARG 1) (SETQ X (COND { (GREATERP N 1) (ARG 2)) ((ADD NEG-SCREEN-LIMIT CONSIZE)))) (COND {(GREATERP N 2) (ARG 3)) {(SOB SCREEN-LIMIT CONSIZE*2))) (FIX (DIVIDE (SUB SCREEN-WIDTH X) TXTHT)) STAR-PPLEV TXTHT*2)) (DISPL) ) ; (#DISPLAY VAR VAR ...) ;CONTROLS DISPLAY OF VARIABLES. ;IF VAR IS A NUMBER, IT CONTROLS (ARG N) (DEFUN #DISPLAY NEXPR N (PROG (M Y A ADDR) (INDEX : ARRAY 1) (AGTCON PENON 0 0 :ARRAY) (SETQ M 1 Y TOP-SCREEN-AGT DISP-VARS NIL RMARGIN (MIN RMARGIN (SUB VARS-X DONT-TOUCH))) LOOP (SETQ A (ARG M) ) (AND (NUMBERP A) (SETQ A (MKATOM "ARG " A))) (SETQ DISP-VARS (CONS A DISP-VARS)) (PUT A 'BEGIN (INDEX : ARRAY)) (•INTENSITY NORMAL) (AGTEXT VARS-X Y TXTHT (MKATOM A »" =") : ARRAY) (PUT A * VAL-ADDR (SETQ ADDR (INDEX iARRAY))) (PUT A 'Y Y) (PPD (PUT A 'VALUE 1  81 (•VALUE A •ALIST '"*UNDEF* ") ) (PUT A •X (ADD VARS-X (TIMES TXTHT (ADD (PLEN A) 3) ) ) ) Y VALUE-LENGTH VAR-PPLEV 0) (SETQ A (SUB (INDEX : ARRAY) ADDR) Y (SUB Y TXTHT*2) ) (AND (LESSP A AGT-VALUE-LENGTH). (AGTCON JUMPR (SUB AGT-VALUE—LENGTH A) 0 ; ARRAY) ) (INDEX :ARRAY (ADD ADDR AGT-VALUE-LENGTH)) (SETQ M (ADD1 M) ) (OR (GREATERP M N) (GO LOOP) ) {•INTENSITY NORMAL) (AGTCON PENOFF 0 0 :ARRAY) (•DASH) {•GOTO SCREEN-LIMIT (ADD TXTHT Y) ) {•PLOT RMARGIN (ADD TXTHT Y) ) (•PLOT RMARGIN (MIN SCREEN-LIMIT (ADD TXTHT^2 TOP-SCREEN-AGT) )) (•UNDASH) (SETQ STACK-TOP Y Y-FOLLOW-VARS Y X-FOLLOW-VARS (SUB VARS-X (ADD FOLLOWER-SIZE DONT-TOUCH)) FWA-VARS (DISPL)))) ;A USER CALL TO MAKE SURE AN ATOMIC VALUE IS DISPLAYED ; PROPERLY. ; IT IS USED AFTER AN NCONC ETC. WHEN A VALUE CHANGE IS NOT ; APPARENT TO THE ANIMATION. (DEFUN #REDISP NEXPR (AT) (VAR-CHANGE AT (•VALUE AT (COND (EVALING? A) (•ALIST) ) •"•UNDEF+ »))) ;NAME THE FUNCTION WHICH IS THE STAR OF ANIMATION (DEFUN tSTAR NEXPR (F) (PROG (N) (PUT F •STAR (COPYSTAR (GET F • EXPR '(RETURN (ERRMSG (F) IS  82 NOT AN "EXPR.") ))••))  (SETQ STAR F) (INDEX zARRAY 1) (•INTENSITY BRIGHT) (AGTCVT 0 0 NIL NIL :ARRAY) (AGTEXT NEG-SCREEN-LIMIT TOP-SCREEN-AGT TXTHT (MKATOM (FNAME F) ' :) :ARRAY) (•INTENSITY NORMAL) (SETQ STAR-FLAG T N (PPD (GET F 'STAR) NEG-SCREEN-LIMIT (SUB TOP-SCREEN-AGT TXTHT+2) (FIX (DIVIDE (ADD RMARGIN SCREEN-LIMIT) TXTHT)) STAR-PPLEV TXTHT^2) STAR-FLAG NIL TOP-SCREEN-AGT (SUB TOP-SCREEN-AGT (TIMES (ADD 1 N) TXTHT+2) ) ) (•INTENSITY NORMAL) (•DASH) (•GOTO NEG-SCREEN-LIMIT TOP-SCREEN-AGT) (•PLOT RMARGIN TOP-SCREEN-AGT) (•UNDASH) (SETQ TOP-SCREEN-AGT (SUB TOP-SCREEN-AGT TXTHT^2) FWA-STAR (DISPL)) (OR DISP-VARS (SETQ STACK-TOP TOP-SCREEN-AGT))))  ;COPY THE STAR FUNCTION INSERTING BREAKPOINTS FOR THE ADDRESSES ; TO INTENSIFY. (DEFUN COPYSTAR (FORM) (COND ((ATOM FORM) FORM) ((ATOM (CAR FORM)) (COND ((EQNAME (CAR FORM) USER-FORM) (CONS (CAR FORM) (CONS (CADR FORM) (AND (CDDR FORM) (CONS (COPYSTAR (CADDR FORM)) (CDDDR FORM) )•)))) (T (LIST STAR-FORM NIL (COND ( (MEMQ . (CAR FORM) ' (LAMBDA NLAMBDA FLAMBDA PROG) ) (CONS (CAR FORM) (CONS (CADR FORM) (MAPCAR 'COPYSTAR  (CDDR FORM) ) ) ) ) ( (EQ (CAR FORM) ' COND) (CONS (CAR FORM) (MAPCAB » (LAMBDA (X) (MAPCAB •COPYSTAR X)) (CDB FOBM) ) ) ) ({EQ (CAR FOBM) • SETQ) (PBOG (N) (CONS (CAR FORM) (MAPCAB »(LAMBDA (X) (COND (N (SETQ N NIL) (COPYSTAR X)) (T (SETQ N T) X))) (CDR FORM) ) ) ) ) ({EQ (CAR FORM) •SELECT) (CONS (CAB FOBM) (CONS (COPYSTAR (CADR FORM) ) (SELCOPY (CDDR FORM) ) ) ) ) ( (EQ (CAR FORM) * SELECTQ) (CONS (CAR FORM) (CONS (COPYSTAR (CADB FORM) ) (SELQCOPY (CDDB FORM))))) (T (CONS (CAB FORM) (MAPCAB 'COPYSTAR (CDR FORM))))))))) 'COPYSTAR FORM))))  (T (MAPCAB (DEFUN SELQCOPY (F) (COND ( (NULL (CDS F) ) (LIST (COPYSTAR (CAB F) ) ) ) (T (CONS (CONS (CAAB F) (MAPCAB 'COPYSTAR (CDAR F) ) ) (SELQCOPY (CDR F) ) ) ) ).)• (DEFUN SELCOPY (F) (COND ((NULL (CDR F) ) (LIST (COPYSTAR (CAR F) ) ) ) (T (CONS {MAPCAB 'COPYSTAR (CAR F)) (SELCOPY (CDR F) ))))•)  ;(#STACK VAR1 VAR2 ... <#ALL>) (DEFUN fSTACK FEXPB (L) (COND ((NULL (CAB L) ) (SETQ STACK? NIL) ) (T (HAP * (LAMBDA (L) (AND (NUMBE8P (CAB L) ) (BPLACA L (MKATOM *"ARG " (CAB L) ) ))) L) (SETQ STACK-VABS L STACK? T) (AND (MEMQ * # ALL STACK-VABS) (SETQ STACK-VABS T) ) ) ) ) ;MAKE FUNCTIONS AND ATOMS INVISIBLE (DEFUN #EXCLUDE FEXPB (L) (COND ({EQ (CAE L) * ATOM) (COND { (CDS L) (SETQ EXCLUDE-ATOMS (NCONC (CDB L) EXCLUDE-ATOMS) ).) (T (SETQ EXCLUDE-ATOMS NIL)))) {{EQ (CAB L) 'FUNCTION) (COND ({CDB L) (SETQ EXCLUDE-FNS (NCONC (CDB L) EXCLUDE-FNS))) (T (SETQ EXCLUDE-FNS NIL)})))) ;MAKE FUNCTIONS LOOK LIKE SUBBS (DEFUN tBBIEF FEXPB L (COND {{NULL L) (SETQ BRIEF-FNS NIL) ) {(SETQ BBIEF-FNS (NCONC (ARG 1) BRIEF-FNS)))}) ;THE VIEWER WILL BE ACQUAINTED WITH A FUNCTION BY ITS ALIAS, ; NOT ITS SEAL NAME (DEFUN #ALIAS NEXPB (FN ALIAS) {PUT FN 'ALIAS ALIAS)) ;RETURN ALIAS IF IT EXISTS, OTHERWISE SEAL NAME (DEFUN FNAME (FN) (OR (GET FN 'ALIAS) FN)) ;WAIT A GIVEN NUMBER OF SECONDS (CALLED BY *EVAL) (DEFUN #WAIT (SECS) {COND (?STEPMODE (AGTDSP INTS-STEP NIL FULLMODE 1 :BBIGHT) (AGTRD 600) (AGTDSP INTS-STEP NIL  85 FULLMODE 1 :NORMAL) (STEP-AGT) ) (T (AND FILM-LENGTH CAMERA? TIME-FILM-STARTED (GREATERP (ADD (TIMES SECS TIMESCALE) FILM-USED (TIMES 9.999999E-4 (SUB (STATUS 39) TIME-FILM-STARTED))) FILM-LENGTH) (PROGN (#CAMERA NIL) (MSSG INSERT FILM THEN TYPE NIL) (SETQ FILM-USED 0.) (BREAK) (•CAMERA T) ) ) (AGTRD (TIMES TIMESCALE SECS)) (STEP-AGT) ) ) ) ;WAIT FOR A FEW SECONDS (DEFUN REALWAIT (SECS) (SETQ SECS (TIMES SECS TIMESCALE)) (REPEAT * (RTWAIT 18000) (FIX (DIVIDE SECS 60.))) (RTWAIT (REMAIN (FIX (TIMES SECS 300)) 18000))) ;PROCESS BUTTON OR PEN HIT (DEFUN STEP-AGT () (SELECT (BUTTON) (0 (COND ((EQ 0 (PENHIT) ) ) ( (EVAL-PEN) )•) ) (BACKUP-BUTTON (AND EVALING? (PROGN (AGTDSP (CADR LOCLIST) NIL FULLMODE 1 : STACK) (WIPE-VAL) (SETQ STACK-BACKUP STACK?) (*UNEVAL* 2 ) ) ) ) (QUIT-BUTTON (SETQ EVALING? NIL) (AND CAMERA? (•CAMERA NIL)) (UNEVA.L -1 •«***STOPPED***)) (STEPMODE-BUTTON (#STEPMODE T) (REALWAIT SHORT-WAIT) {•WAIT 1)) (AUTO-BUTTON ( •STEPMODE NIL) ) (PLOT-BUTTON (•PLOT) (•WAIT 1.)) (BREAK-BUTTON (BREAK) (tWAIT 0)) (RATE-BUTTON (SETQ tRATE (TIMES 2. (ADD 1.1  (DIAL 1).)) (PRINT (LIST »#RATE #RATE)) (#RATE tRATE) . (REALWAIT MEDIUM-WAIT) (#WAIT 0)) (CAMERA-BUTTON (iCAMERA (NOT CAMERA?) ) XREALWAIT SHORT-WAIT) (tWAIT 0)) NIL)) ;PROCESS PEN HIT (DEFUN EVAL-PEN () (PROG (HIT) (SETQ HIT (PENHIT) ) (COND ((LESSP HIT END-STEP) (REALWAIT SHORT-WAIT)) ((LESSP HIT END-AUTO) (tSTEPMODE NIL) ) ((LESSP HIT FWA-EVAL) (tSTEPMODE T) (CHANGE-VAR) (#WAIT 1)) . (T (PROG (N LIST) (SETQ LIST LOCLIST N 0) LOOP (COND ( (NOT (NUMBERP (CAR LIST))) (RETURN NIL)) ( (GREATERP HIT (CAR LIST) } ) (T (SETQ LIST (CDR LIST) N (ADD1 N) ) (GO LOOP))) (AGTDSP (CAR LIST) NIL FULLMODE 1 : STACK) (WIPE-VAL) (REALWAIT SHORT-WAIT) (SETQ STACK-BACKUP STACK?) (#STEPMODE T) (*UNEVAL* N) )))•)) ;BACK-UP ANIMATION N LEVELS (DEFUN *UNEVAL* (##N##) (COND ({OR (LESSP ##N## 2) (NOT (UNEVAL »EVAL1))) (INDEX '.ARRAY 1) (UNEVAL »*EVAL T)) (T (UNEVAL »EVAL1 (LIST »*UNEVAL* (SUB1 ##N##)))))) ;PROCESS A PEN HIT OF A VARIABLE {DEFUN CHANGE-VAR () (PROG (HIT LIST AT) (SETQ LIST DISP-VARS  HIT (SOB (PENHIT) FWA-VARS)) LOOP (OB (LESSP HIT (GET (CAB LIST) * BEGIN) ) (GBEATEBP HIT (ADD AGT-VALOE-LENGTH (GET (CAR LIST) ' VAL-ADDR) ) ) (GO GOTIT) ) (SETQ LIST (CDR LIST) ) (OB (NOLL LIST) (GO LOOP)) (RETURN NIL) GOTIT (SETQ AT (CAB LIST)) (AGTDSP (SETQ HIT (ADD FWA-VARS (GET AT 'BEGIN) NIL FULLMODE 1 : BRIGHT) (MSSG TYPE THE NEW VALOE FOR: (AT) ) (*SETQ1 AT (READ ERRIN) (COND (EVALING? A) (*ALIST) ) ) (REALWAIT .MEDIUM-WAIT) (AGTDSP HIT NIL FULLMODE 1 :NORMAL) ) ) ; START A NEW SEQUENCE—INITIALIZE EVERYTHING, WIPE SCREENS, ; TIME=0 (DEFUN tSTART () (#RATE 1.) (SETQ STACK? NIL RETURNS? T EVLIS-MOVE? T EVLIS? T SHORTQUOTE T #DEPTH 10000 STACK-VARS NIL EXCLUDE-ATOMS NIL EXCLUDE-FNS NIL BBIEF-FNS NIL) (AND ATAGT? (AGTRD 0 NORMAL-BUTTONS) ) (# BLANK) (STATUS 37)) (DEFUN #END () (#CAMEBA NIL) (MSSG ((TIMES (STATUS 39) 9.999999E-4)) "SECONDS.")) ; BLANK THE SCREENS. ;PUT A PROGRAM IN ADAGE TO PROVIDE A "FIXED" ADDRESS FOR THE ; BEGINNING OF ; THE STACK DISPLAY, WHICH COMES DOWN FROM THE ADAGE LWA. (DEFUN #BLANK {)  88 (OS STACK? (SETQ BMABGIN SCREEN-LIMIT)) (AND STAB (PUT STAB * STAB NIL) ) (AGTDSP 1 T FULLMODE CONTBOL-LEN :CONTBOL) (AGTDSP LWA-ADAGE NIL FULLMODE 1 :EOL) (SETQ TOP-SCREEN-AGT (SUB SCBEEN-LIMIT TXTHT) STACK-TOP TOP-SCBEEN-AGT BOTTOM-SCBEEN-AGT BOTTOM-OF-FILM DISP-VABS NIL STAB NIL FOLLOW-X NIL FBEE INIT-FREE FWA-STAR NIL •FWA-MSGS NIL FWA-VABS NIL FWA-EVAL NIL LAST-STAB NIL) (AND ?STEPMODE (tSTEPMODE T))) ;PLOT THE SCBEEN TO FILE -PLOT* (DEFUN #PLOT () (SETQ PLOTTED? T) (AGPLOT LWA-ADAGE) ) ; (#DEPTH N) SETS THE NUMBEB OF LEVELS OF EVAL TO DISPLAY (DEFUN IDEPTH (N) (SETQ tDEPTH N) ) ;START OR STOP CAMERA (DEFUN tCAMERA (N) (SETQ CAMERA? (MEMQ N '(ON T) ) ) (COND (CAMERA? (AGTCON LIGHTSON 1 0 ;CONTROL CAMEfiA-CONTROL) (OB TIME-FILM-STABTED (SETQ TIME-FILM-STABTED (STATUS 39)))) (T (AGTCON LIGHTSOFF 1 0 :CONTBOL CAHEBA-CONTBOL) (AND TIME-FILM-STABTED (PBOGN (SETQ FILM-USED (ADD FILM-USED (TIMES 9.999999E-4 (SUB (STATUS 39) TIME-FILM-STABTED) ).) ) (MSSG (FILM-USED) SECONDS OF FILM USED  ON THIS CARTRIDGE) (SETQ TIHE-FILM-STARTED NIL)))}) (AGTDSP CAMERA-CONTROL NIL FOLLMODE 1 :CONTROL CAMERA-CONTROL)) ; (STEPMODE X) SETS STEP MODE. X MAY BE; ON, OFF, NIL, T (DEFUN #STEPMODE N (SETQ RESTART-CAMERA (OR RESTART-CAMERA (AND CAMERA? (NOT ?STEPMODE))) ?STEPHODE (OR (EQ N 0) (MEMQ (ARG 1) « (ON T) ).)•) (COND (?STEPMODE (AGTDSP STEP-CONTROL NIL FOLLMODE 1 :NOP) (AND CAMERA? (#CAMERA NIL))) (T (AGTDSP STEP-CONTROL NIL FULLMODE 1 :CONTROL STEP-CONTROL) (AND RESTART-CAMERA (#CAMERA T) (SETQ RESTART-CAMERA NIL)))}) ;THIS BRINGS UP A PATTERN FOR ADJUSTING THE CAMERA ;LOW INTENSITY REDUCES SMEAR (DEFUN #FOCUS () (#BLANK) (#DISP (AGTCON INT 0 0.3 : ARRAY) (•GOTO NEG-SCREEN-LIMIT SCREEN-LIMIT) {•PLOT NEG-SCREEN-LIMIT BOTTOM-OF-FILM) (•PLOT SCREEN-LIMIT BOTTOM-OF-FILM) (•PLOT SCREEN-LIMIT SCREEN-LIMIT) (•PLOT NEG-SCREEN-LIMIT SCREEN-LIHIT) (•PLOT SCREEN-LIMIT BOTTOM-OF-FILH) (•GOTO NEG-SCREEN-LIMIT BOTTOM-OF-FILM) (•PLOT SCREEN-LIMIT SCREEN-LIMIT) (•GOTO 0 SCREEN-LIMIT) {•PLOT 0 BOTTOM-OF-FILM)) (# WAIT 3600) (# BLANK) ) ;DISPLAY A GRID ON THE SCREEN FOR REFERENCE (DEFUN #GRID () (#DISP (DO Y  SCREEN-LIMIT (SUB Y 1.) (LESSP Y BOTTOM-OF-FILM) (AND ( E Q Y 0.) (•INTENSITY BRIGHT)  (DO  (AGTCVT 0 0 NIL NIL :ARRAY)) ( * G O T O N E G - S C R E E N - L I M I T Y) ( • P L O T S C R E E N - L I M I T Y) (AND ( E Q Y 0.) (•INTENSITY NORMAL))) X NEG-SCREEN-LIMIT ( A D D X 1. ) (GREATERP X S C R E E N — L I MIT) (AND ( E Q X 0.) (•INTENSITY BRIGHT) (AGTCVT 0 0 NIL NIL (•GOTO X S C R E E N - L I M I T ) (•PLOT X BOTTOM-OF-FILM)  :ARRAY) )  (AND ( E Q X 0.) {•INTENSITY NORMAL))) (•DASH) (•GOTO N E G - S C R E E N - L I M I T BOTTOM-OF-FILM) {•PLOT S C R E E N - L I M I T BOTTOM-OF-FILM) (•UNDASB.) (•SYMBOL  0.05 0.05 0 0.2)))  ************** EVAL * * * * * * * * * * * * * *  (DEFUN #EVALQ NEXPR N (#EVAL (ARG 1) (COND { (EQ N ((EVAL  1) •ALIST) (ARG 2))))))  (DEFUN #EVAL N (AGTRD 0 ErAL-BUTTONS) (SETQ EVALING? T TEMP-FREE FREE DY-EVAL 0. DY-STACK 0.) (AND STACK? (SETQ RMARGIN (MIN RMARGIN ( S U B STACK-X DONT-TOUCH) ) ) ) (SETQ FWA-FOLLOW FREE FREE ( A D D FWA-FOLLOW FOLLOW-LENGTH) FWA-RETVAL FREE FREE {ADD FWA-RETVAL AGT-VALUE-LENGTH)) (AGTDSP (ADD1 F R E E ) • NIL FULLMODE (SUB1 ROLL-EOL) : ROLL 2) (AGTDSP F R E E N I L FULLMODE 1 : R O L L ) (AND FOLLOW? (AGTDSP (ADD! FWA-FOLLOW)  NIL FULLMODE (SUB1 FOLLOW-LENGTH) :FOLLOW 2) (AGTDSP FWA-FOLLOW N I L FULLMODE 1 :FOLLOW)) (AND RETURNS? (AGTDSP FWA-RETVAL N I L FULLMODE 1 : S K I P - V A L ) ) (SETQ EVAL-ROLL FREE FWA-EVAL (ADD EVAL-ROLL ROLL-LEN) BOTTOM-EVAL (ADD EVAL-BLK-HT BOTTOM-OF-FILM DONT-TOUCH) NBLOCKS (ADD1 ( F I X (DIVIDE (SUB TOP-SCREEN-AGT BOTTOM-EVAL) (ADD DOWN-Y EVAL-BLK-HT)))) NROLL ( F I X (ADD 0.5 (TIMES NBLOCKS ROLL-RATIO))) ROLL-DIST (TIMES NROLL (ADD DOWN-Y EVAL-BLK-HT)) JUMP-ROLL (ADD EVAL-ROLL ROLL-JUMP -1) STACK-BACKUP N I L EVAL-COUNTER (ADD 10000 EVAL-COUNTER) STACK-HEIGHT (SUB (SUB STACK-TOP 0.8) BOTTOM—OF-FILM) STACK-ADDRESS LWA-ADAGE Y-STACK BOTTOM-OF-FILM LAST-STAR N I L STACK-CHOP N I L LAST-RETVAL *" «) (AND STACK? ALIST? (PROG (A LENGTH ADDR-LIST) (SETQ A (COND ( (EQ N 1) * A L I S T ) ((ARG 2 ) ) ) Y-STACK (ADD BOTTOM-OF-FILM (A-HEIGHT A ) ) Y-ALIST (MAX BOTTOM-OF-FILM (SUB Y-STACK LINE-SKIP) ) ) (AGTEXT (SUB STACK-X TXTHT) Y-ALIST TXTHT if (ii : TEMP D (INDEX :ARRAY 1) (MAPC * ALIST-ENTRY A) (SETQ LENGTH (SUB1 (INDEX : ARRAY) ) STACK-ADDRESS (SUB LWA-ADAGE LENGTH) ) (MAPC ' (LAMBDA (X) (ADDPROP (CAR X) •ALIST-ADDR (ADD STACK-ADDRESS (CDR X ) ) ) )  92 ADDR-LIST) (AND (ZEROP LENGTH) (•SYMBOL STACK-X BOTTOM-OF-FILM ii j 11 TXTHT) (SETQ Y-STACK (ADD Y-STACK LINE-SKIP) STACK-ADDRESS (SOB STACK-ADDRESS PAREN-LEN) LENGTH PAREN-LEN)) (AGTDSP STACK-ADDRESS NIL FOLLMODE LENGTH : ARRAY) {AGTCON JUMP STACK-ADDRESS 0 :ARRAY 1) (AGTDSP STACK-JUMP NIL FULLMODE 1 .:ARRAY) (AGTDSP ALIST-LPAREN NIL FULLMODE PAREN-LEN : TEMP) ) ) (INDEX : ARRAY 1) (PROG 1 {•EVAL (ARG 1) (COND ((EQ N 1) •ALIST) ((ARG 2))) NEG-SCREEN-LIMIT TOP—SCREEN-AGT 0 (LIST FWA-EVAL) (LIST STACK-ADDRESS) (LIST Y-STACK) T) (AGTRD 0 NORMAL-BUTTONS) (SETQ EVALING? NIL FREE TEMP-FREE))) (SETQ •ALIST »(•(!. . T) ) *GOLIST NIL) ;FORM A X & Y ;LEVEL* ; LOCLIST  TO BE EVALED THE ALIST SCREEN COORDINATES NUMBER OF LEVELS OF •EVAL LIST OF ADAGE ADDRESSES OF BEGINNING ,OF EACH •EVAL DISPLAY STACKLIST LIST OF ADDRESSES OF STACK DISPLAY ;STACK-Y LIST OF Y-COORDINATES OF STACK TOP DISP? NO DISPLAY IF NIL (DEFUN •EVAL (FORM A X Y LEVELS LOCLIST STACKLIST STACK-Y DISP?) (SETQ LEVELS (ADD LEVEL* 1)) (PROG (RETURN—VALUE BUFLOC OLD-DISP? MIDBOX RGT MID BOT PPSIZE EXIT-FORM STAR-DONE VAR1 VAR2 / #TIMES) (SETQ BUFLOC (CAR LOCLIST) OLD-DISP? DISP?) (AND (EQ LEVEL* (ADD1 tDEPTH) )  93  (SETQ DISP? NIL) ) (DO-SPECIALS) (AND DISP? (DO-EXCLUDES)) (SETQ MID (ADD BOXW/2 X) DWN (SOB Y ARBL) PPSIZE 0 BOT (SUB DSN BOXH) RGT (ADD X BOXW) MIDBOX (SUB DSN BOXH/2)) (COND ((OR DISP? OLD-DISP?) (DISPEV-ENTER) (AND STACK-BACKUP (STACK-BACKUP) ) (#WAIT ENTER—WAIT)) (T (SETQ LOCLIST (CONS BUFLOC LOCLIST)))) (SETQ RETURN-VALUE (EVAL1 FORM)) (COND ((OR DISP? OLD-DISP?) (DISPEV-EXIT) (#WAIT EXIT-WAIT) ) ) (EVAL EXIT-FORM) (RETURN RETURN-VALUE) ) ) (DEFUN EVAL 1 (FORM) (COND ( (NULL FORM) NIL) ((NUMBERP FORM) FORM) ((ATOM FORM) (*VALUE FORM A *(ERRMSG UNDEFINED ATOM: (FORM)))) ((ATOM (CAR FORM)) (SELECTQ (CAR FORM) • (CADR FORM) (COND (*EVCON (CDR FORM) A)) (OR (*OH (CDR FORM) ) ) (AND (*AND (CDR FORM))) (PROG (PROGl (*PROG (CDR FORM) A) (UNBIND-DISP (CADR FORM)))) (PROGN (*EVALIST (CDR FORM) A)) (SETQ (FOLLOW (ADD X BOXW FOLLOWER-SIZE DONT-TOUCH) (SUB (ADD Y DY-EVAL) EVAL-BLK-HT) ) (PROG1 (*SETQ (CDR FORM) A) (FOLLOW-OFF))) (SET (FOLLOW (ADD X BOXW FOLLOWER-SIZE DONT-TOUCH) (SUB (ADD Y DY-EVAL) EVAL-BLK-HT)) (PSOG1 (*SET (CDR FORM)  94 A) (FOLLOW-OFF))) (ARG (*VALUE (MKATOM '"ARG " (*EVAL (CADR FORM) A (RIGHT) (RIGHTY) LEVEL* LOCLIST STACKLIST STACK-Y DISP?) ) A •(ERRMSG ARG ((CADR FORM)) IS UNDEFINED) )•)• (RETURN (RETURN (*EVAL (CADR FORM) A (RIGHT) (RIGHTY) LEVEL* LOCLIST STACKLIST STACK-Y DISP?) »*PROG)) (GO (SETQ PROGFORM (ASSOC (CADR FORM) *GOLIST ' (ERRMSG NO ' LABEL: ( (CADR FORM) ) IN PROG))) *" ") (SELECT (*SELECT (SELECT-THING) (CDDR FORM) ) ) (SELECTQ (*SELECTQ (SELECT-THING) (CDDR FORM) ) ) (APPLY (APPLY »*APPLY (NCONC (*EVLIS (CDR FORM) A) A) ) ) (EVAL (*EVAL (PROG 1 (*EVAL (CADR FORM) A (RIGHT) (RIGHTY) LEVEL* LOCLIST STACKLIST STACK-Y DISP?) (WIPE-OUT) ) A X  95 (DOWN) LEVEL* LOCLIST STACKLIST STACK-Y DISP?})  (PROG (EXP) (COND ((SETQ EXP (OR (GET (CAR FORM) * STAR) (GET (CAR FORM) »EXPR) ) ) (*APPLY EXP (PROG1 (COND ((EQ (CAR EXP) * NLAMBDA) (CDR FORM)),) EXP) •FLAMBDA) (LIST (CDR FORM)))) (CDR FORM)  (DISP-NF ((EQ (CAR  (DISP-NF (T (*EVLIS  A) ) ) (AND (MEMQ (CAR FORM) BRIEF-FNS) NIL) ) )  (SETQ DISP?  A)) ( (GET (CAR FORM) «SOBR) (APPLY (CAR FORM) (*EVLIS (CDR FORM) A)}) ( (GET (CAR FORM) ' NSOBR) (ERRMSG NSUBR: ((CAR FORM))) (APPLY (CAR FORM) (CDR FORM))) ({GET (CAR FORM) * FSDBR) (ERRMSG FSOBR: ({CAR FORM)}) {APPLY (CAR FORM) (LIST (CDR FORM) ) ) ) ( (CAR FORM) (*EVAL (CONS (*VALUE (CAR FORM) A » (ERRMSG UNDEFINED  FUNCTION: {(CAE  FORM))))  (CDR FORM) ) A (RIGHT) (RIGHTY) LEVEL* LOCLIST STACKLIST STACK-Y DISP?))))))  ( (EQ (CAAR FORM) * NLAMBDA) (•APPLY (CAR FORM) (CDR FORM) A)) { (EQ (CAAR FORM) 'FLAMBDA) (•APPLY (CAR FORM) (LIST (CDR FORM)) A)) (T (•APPLY (CAR FORM) (•EVLIS (CDR FORM) A) A)) ) ) (DEFUN •APPLY (FN ARGS A) (COND ( (NULL FN) NIL) {(ATOB FN) (PROG (EXP) (COND ((SETQ EXP (OR  (GET FN »STAfl) (GET FN »EXPR)) ) (AND (MEMQ FN BRIEF-FNS) (SETQ DISP? NIL)) (•APPLY EXP ARGS A)) ((GET FN •SUBR) (APPLY FN ARGS)) ((GET FN • FSUBR) (APPLY FN ARGS)) ((GET FN 'NSUBR) (APPLY FN ARGS)) (T (•APPLY (•VALUE FN A » (ERRMSG UNDEFINED FUNCTION (FN))) ARGS A))))) ((EQ (CAR FN) STAR-FORM) (DO-STAR (CADR FN) ) (•APPLY (CADDR FN) ARGS A) ) ((MEMQ (CAR FN) •(LAMBDA NLAMBDA FLAMBDA)) (COND ( (AND (LISTP (CADR FN)) (N EQ (LENGTH (CADR FN) ) (LENGTH ARGS))) (ERRMSG WRONG NUMBER OF ARGUMENTS TO: (FN))) (T (PROG 1 {•EV ALIST (CDDR FN) (NCONC (STACK-DISP (•PAIR (CADR FN)  97 ARGS) ) (UNBIND-DISP (T {*APPLY (*EVAL FN A (RIGHT) (RIGHTY) LEVEL* LOCLIST STACKLIST STACK-Y DISP?) ARGS A) ) ) )  A)-) (CADR FN})))))  (DEFUN *EVCON (C A) (COND ( (NULL C) NIL) {{NULL (CDAR C)) (COND ( (NULL (CDR C)) (*EVAL (CAAR C) A X (DOWN) LEVEL* LOCLIST STACKLIST STACK-Y DISP?) ) ( (*EVAL (CAAR C) A (RIGHT) (RIGHTY) LEVEL* LOCLIST STACKLIST STACK-Y DISP?) ) (T (WIPE-OUT) (*EVCON (CDR C) A)))) ((*EVAL (CAAR C) A (RIGHT) (RIGHTY) LEVEL* LOCLIST STACKLIST STACK-Y DISP?) (WIPE-OUT) (*EVALIST (CDAR C) A) ) (T (WIPE-OUT) (*EVCON (CDR C) A)))) (DEFUN *OR (L) (COND ( (NULL L) NIL) ((*EVAL (CAR L) A  98 (SIGHT) (EIGHTY) LEVEL* LOCLIST STACKLIST STACK-Y DISP?) ) (T (WIPE-OUT) (*OR (CDS L) ) ) ) ) (DEFUN *AND (L) (COND ( (NULL (CDS L) ) (*EVAL (CAR L) A (SIGHT) (RIGHTY) LEVEL* LOCLIST STACKLIST STACK-Y DISP?)) ((*EVAL (CAR L) A (RIGHT) (RIGHTY) LEVEL* LOCLIST STACKLIST STACK-Y , DISP?) (WIPE-OUT) (*AND (CDR L) ) ) ) ) (DEFUN *EVLIS (H A) (COND ((AND DISP? EVLIS? EVLIS-MOVE?) (PROG (EV-LOC EVLIS-Y EV-RIGHT) (SETQ EVLIS-Y (SUB Y (ADD LINE-SKIP < EVAL-BLK-HT)) EV-LOC LOCLIST EV-RIGHT RIGHT-X) (PROG1 (MAPLIST (LAMBDA (J) (DISP-EVLIS (*EVAL (CAR 1  J)  A (RIGHT EV-EIGHT) (RIGHTY) LEVEL* EV-LOC STACKLIST  99 STACK-Y DISP?))) M) (REALWAIT SHORT-WAIT)))) (T (MAPLIST • (LAMBDA (J) (PROG 1 (*EVAL (CAR J) A (RIGHT) (RIGHTY) LEVEL* LOCLIST STACKLIST STACK-Y (AND EVLIS? DISP?)) (WIPE-OUT) ) ) M) )) ) ;RETURNS THE VALUE OF ATOM. IF NO VALUE ; IS FOUND, ERROR IS EVALED (DEFUN *VALUE (ATOM ALIST ERROR) (PROG (V AL) (COND {(NULL ATOM) NIL) {(SETQ VAL (ASSOC ATOM ALIST)) (AND REFS? (MEMQ ATOM DISP-VARS) (PROG (HIT) (FOLLOW (ADD X BOXW FOLLOWER-SIZE DONT-TOUCH) (SUB (ADD Y DY-EVAL) EVAL-BLK-HT) ) (FOLLOW X-FOLLOW-VARS Y-FOLLOW-VARS) (FOLLOW-OFF) (AGTDSP (SETQ HIT (ADD FWA-VARS (GET ATOM •BEGIN) -1) ) NIL FULLMODE 1 :BRIGHT) (REALWAIT MEDIUM-WAIT) (AGTDSP HIT NIL FULLMODE 1 : NORMAL) (REALWAIT SHORT-WAIT))) (CDR VAL)) (T (EVAL ERROR)} ) ) ) f  100 ;PAIR ATOMS WITH VALUES FOR ALIST. ALSO DOES NO-SPREAD BINDING (DEEUN *PAIR (W Z) (COND ((LISTP W) (PAIR 1 W Z) ) ( (NULL W) NIL) (T (PROG (N) (SETQ N 0) (CONS (CONS W (LENGTH Z)) (MAPCAR •(LAMBDA (X) (CONS (MKATOM '"ARG " (SETQ N (ADD 1 N))) X) ) Z) )•)•))) (DEFUN PAIR 1 (W Z) (COND { (NULL W) NIL) (T (CONS (CONS (PAIR  (CAR W) (CAR Z)) (CDR W) (CDR Z ) ) ) ) ) )  ;EVALS A LIST RETURNING THE LAST (DEFUN *EVALIST (L A) (COND { (NULL (CDR L) ) (*EVAL (CAR L) A X (DOWN) LEVEL* LOCLIST STACKLIST STACK-Y DISP?)) (T (*EVAL (CAR L) A X (DOWN) LEVEL* LOCLIST STACKLIST STACK-Y DISP?) (WIPE-GUT) (*EVALIST (CDR L) A) ) ) ) (DEFUN *PROG (D A) (PROG (*GOLIST) (SETQ *GOLIST (*GETLABELS (CDR D)) ) (*EVALPROG (CDR D) (NCONC (STACK-DISP (*PAIRNIL A)))) ;PAIRS A LIST OF PROG VARIABLES WITH NIL (DEFUN *PAIRNIL (W)  (CAR D) ))  101 (COND ( (NULL W) NIL) (T (CONS (CONS (CAB W) NIL) (*PAIRNIL (CDR H) ) ) ) )•) ;FIND LABELS IN A PROG. BETUBNS LIST: {(LABEL . FORM) ( . (DEFUN *GETLABELS (W) (COND {(NULL K) NIL) ({LISTP (CAR W)) (*GETLABELS (CDR W))) (T (CONS {CONS (CAR W) (CDR H) ) (*GETLABELS (CDR W) ) ) ) ) )  .),)  ;LIKE EVALIST, BUT IGNORES ATOMS. MTS STYLE PBOG. EVAL CHANGES ; PBOGFOBM WHEN A "GO" IS DONE. (DEFUN *EVALPROG (PROGFORM A) (COND ({NULL (CDS PROGFORM) ) (COND ({ATOM (CAR PROGFORM)) PROGFORM) (T (*EVAL (CAR PROGFORM) A X (D08N) LEVEL* LOCLIST STACKLIST STACK-Y DISP?) (COND ( (CDR PROGFORM) (*EVALPROG (CDR PBOGFOBM) A)))))) (T (COND ((LISTP (CAR PROGFORM)) (*EVAL (CAB PBOGFOBM) A X (DOWN) LEVEL* LOCLIST STACKLIST STACK-Y DISP?) (WIPE-OUT) ) ) (*EVALPRGG (CDR PROGFORM) A ) ) ) ) (DEFUN *SETQ (Q A) (COND ( (LISTP (CAB Q) ) (ERRMSG ATTEMPT TO SETQ: ((CAB Q) )•) ) ({NULL (CDDR Q)) (*SETQ1 (CAR Q) (*EVAL (CADR Q) A (RIGHT) (RIGHTY) LEVEL* LOCLIST STACKLIST STACK-Y  102 DISP?) A)) (T {•SETQI (CAE Q) (•EVAL (CADR Q) A (RIGHT) (RIGHTY) LEVELS LOCLIST STACKLIST STACK-Y DISP?) A) (WIPE-OOT) (•SETQ (CDDR Q) A) ) ) ) (DEFUN •SET (Q A) (PROG (AT) (SETQ AT (*EVAL (CAR Q) A (RIGHT) (RIGHTY) LEVELS LOCLIST STACKLIST STACK-Y DISP?)) (WIPE-OUT) (COND ( (LISTP (CAR Q) ) (ERRMSG ATTEMPT TO SET: (AT))) ((NULL (CDDR Q)) (•SETQ1 AT (•EVAL (CADR Q) A (RIGHT) (RIGHTY) LEVELS LOCLIST STACKLIST STACK-Y DISP?) A)) (T {•SETQ1 AT (•EVAL (CADR Q) A (RIGHT) (RIGHTY) LEVELS LOCLIST STACKLIST STACK-Y DISP?) A) (WIPE-OUT) (•SET (CDDR Q) A)))))  103 ;USED BY *SET *SETQ #SET #SETQ & CHANGE-VAR (DEFUN *SETQ1 (W Z A) (COND ( (EQ ST (CAAR A)) (RPLACD (CAR A) Z) (VAR-CHANGE W Z) (COND ((AND ALIST? (GET « . •ALIST-X)) (PROG (LENGTH ADDR Y) (INDEX : ARRAY 1) (PPD (CAR A) STACK-X (SETQ Y (GET H »ALIST-Y)) VALUE-LENGTH VAR-PPLEV 0) (SETQ LENGTH (SUB1 (INDEX :ARRAY))) (FOLLOW (SUB STACK-X (ADD FOLLOWER-SIZE DONT-TOUCH)) Y) (COND { (EQ Y BOTTOM-OF-FILM) (AND (LESSP LENGTH (SUB AGT-VALUE-LENGTH PAREN-LEN) ) (AGTCON JUMPR (SUB AGT-VALUE-LENGTH (ADD LENGTH PAREN-LEN) ) (AGTEXT  0 : ARRAY) )  "+X+" (ADD Y-ALIST LINE-SKIP) TXTHT HJ n : ARRAY (ADD1 (SUB AGT-VALUE-LENGTH, PAREN-LEN)) ) ) { (LESSP LENGTH AGT-VALUE-LENGTH) (AGTCON JUMPR (SUB AGT-VALUE-LENGTH LENGTH) 0 :ARRAY) ) ) (AGTDSP (SETQ ADDR (SUB1 (GET W »ALIST-ADDR)}) NIL FULLMODE 1 :SKIP-VAL) (AGTDSP (ADD 1 ADDR)  NIL FULLMODE (SUB 1 AGT-VALUE-LENGTH) ;ARRAY 2) (AGTDSP ADDR NIL FULLMODE 1 : ARRAY) (FOLLOW-OFF) (REALWAIT SHORT-WAIT))))  Z) ( (NULL (CDR A) ) (NCONC A (CONS (CONS W Z) (VAR-CHANGE W Z)  NIL))  Z)  (T (*SETQ1 W Z (CDR A) ) ) ) ) (DEFUN SELECT-THING () (SETQ EV-LOC LOCLIST) (COND (DISP? (PROG (EVLIS-Y) (SETQ EVLIS-Y  (SUB Y (ADD LINE-SKIP EVAL-BLK-HT) ) ) (PROG 1 (DISP-EVLIS (*EVAL (CADR FORM) A (RIGHT) (RIGHTY) LEVEL* LOCLIST STACKLIST STACK-Y DISP?)) (REALWAIT SHORT-WAIT)))) (T (*EVAL (CADR FORM) A (RIGHT) (RIGHTY) LEVEL* LOCLIST STACKLIST STACK-Y DISP?))))  (DEFUN *SELECT (THING CHOICES) (COND ({NULL (CDR CHOICES)) (*EVAL (CAR CHOICES) A X (DOWN) LEVEL* EV-LOC STACKLIST STACK-Y  DISP?)) ((EQUAL THING (•EVAL-(CAAE CHOICES) A (SIGHT) (EIGHTY) LEVELS EV-LOC STACKLIST STACK-Y DISP?) ) (WIPE-OUT) (•EVALIST (CDAE CHOICES) A) ) (T (WIPE-OUT) (•SELECT THING (CDS CHOICES))})) (DEFUN •SELECTQ (THING CHOICES) (COND ( (NULL (CDS CHOICES) ) {•EVAL (CAR CHOICES) A X (DOWN) LEVELS EV-LOC STACKLIST STACK-Y DISP?)) ({COND { (ATOM (CAAR CHOICES) ) (EQ THING {CAAE CHOICES))) ( (MEMQ THING (CAAR CHOICES)))) {•EVALIST (CDAR CHOICES) A) ) ({•SELECTQ THING (CDR CHOICES)))))  ;*****************  DISPLAY ***************** DISPLAYS :ARRAY FOLLOWED BY EOL. RETURNS FWA (DEFUN DISPL () (PROG (N) (SETQ N (INDEX : ARRAY) ) (AGTCVT 0 0 NIL T :ARRAY) (AGTDSP FREE NIL FULLMODE 1 :EOL) (AGTDSP (ADD1 FREE) NIL FULLMODE (SUB1 N) :ARRAY 2) (AGTDSP FREE NIL FULLMODE 1 : ARRAY) (PROG1 FREE (SETQ FREE {ADD FREE N -1) ) } ) ) ;DISPLAYS :ARRAY FOLLOWED BY A JUMP TO THE STACK (DEFUN DSP-EVAL (LOC LEN) (JUMP EVAL-RETURN) (AGTDSP (ADD 1 LOC) NIL FULLMODE (SUB1 LEN) : ARRAY 2)  (AGTDSP LOC NIL FULLMODE 1 : ARRAY)) ;ROLLS THE EVAL DISPLAY THE GIVEN DISTANCE (+=OP) ;ROLL-RATE IS DISPLAY-UNITS / SECOND (DEFUN ROLL-EVAL (DIST) (PROG (SECS NFRAMES) (SETQ DY-EVAL (ADD DIST DY-EVAL) BOTTOM-EVAL (SUB BOTTOM-EVAL DIST) SECS (DIVIDE (ABS DIST) ROLL-RATE) DIST (TIMES DIST DY-DX-SCALE) NFRAMES (TIMES SECS FRAMES/SEC}) (AGTCON INCR 0 (DIVIDE DIST NFRAMES) :TEMP 2) (SETQ NFRAMES (FIX (ABS (DIVIDE DIST (DIVIDE (CVT-AGTNUM (CADR (CONAGT :TEMP 2))) 8192.))))) (AGTCON SKIPZ NFRAMES 0 :TEMP 1) (AGTDSP EVAL-ROLL NIL FULLMODE 2 :TEMP) (AND RETURNS? (AGTDSP (ADD FWA-RETVAL U) NIL FULLMODE 2 : TEMP)) (REALWAIT (DIVIDE NFRAMES FRAMES/SEC)))) ;CONVERT AGT NUMBER TO SIGNED INTEGER (DEFUN CVT-AGTNUM (X) (COND ( (GREATERP X 8192) (SUB X 16383)) (X))) ;CHANGE A DISPLAYED ATOMIC VALUE (DEFUN VAR-CHANGE (AT VAL) (COND ( (AND (MEMQ AT DISP-VARS) (NEQ VAL (GET AT 'VALUE '"*UNDEF* " ) ) ) (PROG (LENGTH ADDR) (AND (NUMBERP AT) (SETQ AT (MKATOM '"ARG " AT))) (AND FOLLOW-X (FOLLOW X-FOLLOW-VARS Y-FOLLOW-VARS)) (PUT AT 'VALUE VAL) (INDEX : ARRAY 1) (PPD VAL (GET AT «X) (GET AT «Y) VALUE-LENGTH VAR-PPLEV 0) (SETQ LENGTH (SUB1 (INDEX :ARRAY))) (AND (LESSP LENGTH AGT-VALUE-LENGTH) (AGTCON JUMPR  107 (SOB AGT-VALOE-LENGTH LENGTH) 0 :ARRAY) ) (SETQ ADDR (ADD FWA-VARS (GET AT * VAL-ADDfi) -1) ) (AGTDSP ADDR NIL FULLMODE 1 :SKIP-VAL) (AGTDSP (ADD1 ADDR) NIL FOLLHODE (SIN LENGTH (SUB1 AGT-VALUE-LENGTH) ) :ARRAY 2) (AGTDSP ADDR NIL FULLMODE 1 :ARRAY) (REALWAIT MEDIUM-WAIT))))) ;DISPLAY NEW STACK BLOCK ; THE NULL- WORD IS TO STORE AN EOL WHEN ROLLED OFF SCREEN (DEFUN STACK-DISP (L) (COND { (AND STACK? DISP?) (PROG (LENGTH ADDR ADDR-LIST) (SETQ Y-STACK (ADD DONT-TOUCH (CAR STACK-Y) ) ) (FOLLOW (ADD X BOXW FOLLOWER-SIZE DONT-TOUCH) (SUB (ADD Y DY-EVAL) EVAL-BLK-HT)) STACK-X (FOLLOW (SUB (ADD FOLLOWER-SIZE DONT-TOUCH)) Y-STACK (ADD FOLLOWER-SIZE DY-STACK}) (REALWAIT SHORT-WAIT) (AGTCVT 0 0 NIL NIL :ARRAY 1) (COND (ALIST? (SETQ Y-STACK (ADD (CAR STACK-Y) (A-HEIGHT L ) ) Y-ALIST (SUB Y-STACK LINE-SKIP)) (AGTEXT (SUB STACK-X TXTHT) Y-ALIST TXTHT : TEMP D  (AND L (MAPC 'ALIST-ENTRY I.))) (T (AND L (MAPC * STACK-ENTRY L)) (*DASH) (*GOTO STACK-X  108 (SETQ Y-STACK (ADD DONT-TOUCH Y-STACK))) (*PLOT SCBEEN-LIMIT Y-STACK) (*UNDASH) ) ) (SETQ LENGTH (SUB1 (INDEX :ABBAY)) STACKLIST (CONS (SETQ ADDR (SUB (CAB STACKLIST) LENGTH) ) STACKLIST) STACK-Y (CONS Y-STACK STACK-Y)) (AND (GBEATERP Y-STACK STACK-TOP) (STACK-BOLL) ) (AGTDSP ADDR NIL FULLMODE LENGTH ; ABBAY) (AGTCON JUMP ADDR 0 :ARRAY 1) (AND ALIST? (AGTDSP ALIST-LPAREN NIL FULLMODE PABEN-LEN : TEMP) (MAPC *(LAMBDA (X) (ADDPBOP (CAB X) 'ALIST-ADDB (ADD ADDB (CDB X ) ) ) ) ADDR-LIST) ) (AGTDSP STACK-JUMP NIL FULLMODE 1 ; ABBAY) (AND L (MAPC • (LAMBDA (X) (VAB-CHANGE (CAB X) (CDR X))) L)) (FOLLOW-OFF) ) ) (T (COND ((AND DISP? L) (FOLLOW (ADD X BOXW FOLLOWER-SIZE DONT-TOUCH) (SUB (ADD Y DY-EVAL) EVAL-BLK-HT)) (MAPC ' (LAMBDA (X) (VAfi-CHANGE (CAB X) (CDB X))) L) (FOLLOW-OFF) ) ) (SETQ STACKLIST (CONS (CAB STACKLIST) STACKLIST) STACK-Y (CONS (CAB STACK-Y) STACK-Y)))) I)  ;PUT A VALUE ON THE STACK (DEFUN STACK-ENTRY (AT) (SETQ AT (CAR AT) ) (COND ((OR (EQ STACK-VARS T) (MEMQ AT STACK-VARS)) (AGTEXT STACK-X Y-STACK TXTHT (MKATOM AT '" =") : ARRAY) (PPD (*VALUE AT A *"*UNDEF* ») (ADD STACK-X (TIMES TXTHT (ADD 3 (PLEN AT)))) Y-STACK VALUE-LENGTH VAR-PPLEV 0) (SETQ.Y-STACK (ADD Y-STACK LINE-SKIP))))) ;MAKE A-LIST ENTRY ON STACK DISPLAY (DEFUN ALIST-ENTRY (L) (COND ((OR (EQ STACK-VARS T) (MEMQ (CAR L) STACK-VARS)) (SETQ.ADDR (INDEX :ARRAY)) (PPD L STACK-X Y-ALIST VALUE-LENGTH VAR-PPLEV 0) (SETQ A DDR-LIST (CONS (CONS (CAR L) ADDR) ADDR-LIST)) (ADDPROP (CAR L) 'ALIST-Y Y-ALIST) (SETQ LENGTH (SUB (INDEX : ARRAY) ADDR) Y-ALIST (SUB Y-ALIST LINE-SKIP)) (COND ((LESSP Y-ALIST BOTTOM-OF-FILM) (AND (LESSP LENGTH (SUB AGT-VALUE-LENGTH PAREN-LEN) ) (AGTCON JUMPR (SUB AGT-VALUE-LENGTH (ADD LENGTH PAREN-LEN) ) 0 : ARRAY)) (AGTEXT "+X+" (ADD Y-ALIST LINE-SKIP) TXTHT II  :ARRAY (ADD ADDR (SUB AGT-VALUE-LENGTH PAREN-LEN) ) ) ) ((LESSP LENGTH AGT-VALUE-LENGTH) (AGTCON JUMPR  (SUB AGT-VALUE-LENGTH LENGTH) 0 : ARRAY) )•) (INDEX :ARRAY (ADD ADDR AGT-VALUE-LENGTH))))) ;DETERMINE THE HEIGHT OF AN ALIST DISPLAY ENTRY (DEFUN A-HEIGHT (L) (PROG (N) (AND (EQ STACK-VARS T) (RETURN (TIMES LINE-SKIP (LENGTH L) ) )) (SETQ N 0) (MAPC » (LAMBDA (X) (AND (MEMQ (CAR X) STACK-VARS) (SETQ N (ADD N LINE-SKIP)))) (RETURN N))) ;DECIDES HOW MUCH TO ROLL THE STACK (DEFUN STACK-ROLL () (PROG (N LIST OLD) (SETQ LIST STACK-Y N 1 OLD STACK-CHOP) LOOP (AND (MINUSP (ADD (CAR LIST) DY-STACK)) (GO DONE)) (SETQ N (ADD1 N) LIST (CDR LIST)) (GO LOOP) DONE (AGTDSP (SETQ STACK-CHOP (CAR (NTH STACKLIST N))) NIL FULLMODE 1 :EOL) (AND OLD (AGTDSP OLD NIL FULLMODE 1 :NOP)) (ROLL-STACK (SUB BOTTOM-OF-FILM (ADD DY-STACK (CAR L I S T ) ) ) ) ) ) ;ROLL THE STACK DISPLAY (DEFUN ROLL-STACK (DIST) (PROG (SECS NFRAMES) (SETQ DY-STACK (ADD DY-STACK DIST) SECS (DIVIDE (ABS DIST) ROLL-RATE) STACK-TOP (SUB STACK-TOP DIST) DIST (TIMES DIST DY-DX-SCALE) NFRAMES (TIMES SECS FRAMES/SEC)) (COND ( (NEQ 0 NFRAMES) (AGTCON INCR 0 (DIVIDE DIST NFRAMES) :TEMP 2) (SETQ NFRAMES (FIX (ABS (DIVIDE DIST (DIVIDE  (CVT-AGTNUM  (CADE (CONAGT :TEMP 2)})  8192.))))) (AGTCON SKIPZ NFRAMES 0 :TEMP 1) (AGTDSP STACK—ROLL-ADDR NIL FOLLMODE 2 :TEMP) (REALSAIT (DIVIDE NFRAMES FRAMES/SEC)))))) ;CHANGE DISPLAY AS STACK POPS (DEFON ONBIND-DISP (LIST) (AND LIST (ATOM LIST) (PROG (N L) (SETQ N 0 L NIL) (REPEAT (SETQ L (CONS (MKATOM '"ARG." (SETQ N (ADD1 N) L}) (LENGTH ARGS)) (SETQ LIST (CONS LIST 1) ) )•)• (COND ( (AND STACK? DISP?) (FOLLOW-OFF) (FOLLOW (ADD X BOXW FOLLOWER-SIZE DONT-TOUCH) (SUB (ADD Y DY-EVAL) EVAL-BLK-HT)) (FOLLOW (SUB STACK-X (ADD FOLLOWER-SIZE DONT-TOUCH)) (ADD (CAR STACK-Y) FOLLOWER-SIZE DY-STACK) ) (COND (ALIST? (MAPC (LAMBDA (AT) (REM AT 'ALIST-ADDR) (REM AT •ALIST-Y)) LIST) (AGTEXT (SUB STACK-X TXTHT) (SUB (CADR STACK-Y) LINE-SKIP) TXTHT ii (ii : TEMP 1  1  D  (AGTDSP ALIST-LPAREN NIL FULLMODE PAREN-LEN : TEMP) ) ) (AGTCON JUMP (CADR STACKLIST) 0 :TEMP 1) (AGTDSP STACK-JUMP NIL FULLMODE 1 :TEMP)  112 (SETQ STACK-Y (CDR STACK-Y) STACKLIST (CDR STACKLIST)) (ROLL-ST ACK-BACK) (MAPC • (LAMBDA (AT) (VAR-CHANGE AT (•VALUE AT A '"*UNDEF* " ) ) ) LIST) (FOLLOW-OFF) ) ((AND LIST DISP?) (FOLLOW-OFF) (FOLLOW (ADD X BOXW FOLLOWER-SIZE DONT-TOUCH) (SUB (ADD Y DY-EVAL) EVAL-BLK-HT)) (MAPC » (LAMBDA (AT) (VAR-CHANGE AT (•VALUE AT A • "*UNDEF* ") ) ) LIST) (FOLLOW-OFF) )) ) (DEFUN ROLL-STACK-BACK () (COND ((AND {LESSP (ADD DY-STACK DONT-TOUCH) 0.) (LESSP (CAR STACK-Y) (SUB STACK-TOP STACK-HEIGHT))) (ROLL-STACK (MIN STACK-HEIGHT (MINUS DY-STACK))) (PROG (N LIST OLD) (SETQ LIST STACK-Y N 1 OLD STACK-CHOP) LOOP (OR (GREATERP (ADD (CAR LIST) DY-STACK) BOTTOM-OF-FILM) (GO DONE) ) (SETQ N (ADD1 N) LIST (CDR LIST)) (GO LOOP) DONE (AGTDSP (SETQ STACK-CHOP (CAR (NTH STACKLIST N))) NIL FULLMODE 1 :EOL) (AND OLD (AGTDSP OLD NIL FULLMODE 1 : NOP) ))>.))) ;RESTORE THE STACK I F WE BACK UP (DEFUN STACK-BACKUP () (SETQ STACK-BACKUP NIL) (AGTCON JUMP (CAS STACKLIST) 0 : TEMP 1) (AGTDSP STACK-JUMP NIL FULLMODE 1 :TEMP)  {ROLL-STACK-BACK) (DISP-ALL-VABS) ) ;HAKE SORE ALL DISPLAYED VARIABLES ARE CORRECT (DEFUN DISP-ALL-VARS () (MAPC »(LAMBDA (AT) (VAR-CHANGE AT (•VALUE AT A «»*UNDEF* " ) ) ) DISP-VARS)) ;THIS CLEARS THE RETURN VALUE (DEFUN WIPE-VAL () (COND ((AND RETURNS? (NEQ LAST-RETVAL »)) (AGTDSP FWA-RETVAL NIL FOLLMODE 1 :SKIP-VAL) (SETQ LAST-RETVAL ") ) ) ) (DEFUN WIPE-OUT () (AND DISP? (REALWAIT SHORT-WAIT) (WIPE-VAL))) ;CALCULATE POSITION OF EVAL BLOCK TO THE RIGHT, AND DRAW AN ; ARROW (DEFUN RIGHT N (INDEX : ARRAY 1) (COND (DISP? {•GOTO RGT MIDBOX) (•PLOT (SETQ X-ARROW (ADD X (COND ((ZEROP N) RIGHT-X) ((MAX (ARG 1) RIGHT-X))))) (SETQ Y-ARROW (SUB Y (ADD PPSIZE DONT-TOUCH)))) (SETQ SLOPE (DIVIDE (SUB MIDBOX Y-ARROW) (SUB RGT X-ARROW) ) ) {•PLOT (SUB X-ARROW (TIMES (ADD 1. SLOPE) BARBSIZE)) (ADD Y-ARROW (TIMES (SUB 1 . (TIMES SLOPE 0.5)) BARBSIZE))) {•GOTO (SUB X-ARROW (TIMES (SUB 1. (TIHES SLOPE 0.5)) BARBSIZE)) (SUB Y-ARROW (TIMES (ADD 1. SLOPE) BARBSIZE) ) ) (•PLOT X-ARROW Y-ARROW)  114 (X) ) )  (ADD X-ARROW DONT-TOUCH))  ;CALCULATE THE "Y" POSITION OF AN EVAL BLOCK PLACED TO THE ; RIGHT (DEFUN RIGHTY () (COND (DISP? (SUB Y (ADD PPSIZE TXTHT DONT-TOUCH)))  am  ;CALCULATE POSITION OF EVAL BLOCK DOWNWARDS, AND DRAW AN ARROW (DEPUN DOWN () (INDEX : ARRAY 1) (COND (DISP? {•GOTO MID BOT) {•PLOT MID (SETQ Y-ARROW (MIN (SUB Y (ADD PPSIZE TXTHT DONT-TOUCH) ) (ADD TXTHT (SUB Y (ADD DOWN-Y EVAL-BLK-HT) ) )) ) ) {•PLOT (ADD MID BARBSIZE) (ADD Y-ARROW BARBSIZE)) {•GOTO (SUB MID BARBSIZE) (ADD Y-ARROW BARBSIZE)) (•PLOT MID Y-ARROW) (SUB Y-ARROW TXTHT) )  ;CALLED WHEN •EVAL IS ENTERED ;IF DISP? WAS JUST CHANGED TO NIL, MAKE THREE DOTS ;IF WE JUST STARTED DISPLAYING AFTER OMITTING SOME, UPDATE ALL ; DISPLAYED VALUES (DEFUN DISPEV-ENTER () (COND (OLD-DISP?) (T (DISP-ALL-VARS) (SETQ Y (DOWN)))) (COND (DISP? (COND ((LESSP Y BOTTOM-EVAL) (AGTCON JUMP (CAR (NTH LOCLIST (ADD1 (SUB NBLOCKS NROLL)))) 0 : TEMP D  (AGTDSP JUMP-ROLL NIL FULLMODE 1 : TEMP) (ROLL-EVAL ROLL-DIST))) . (SETQ PPSIZE (TIMES LINE-SKIP (PPD FORM  115 (MAX X (SUB (ADD X BOXW/2) (TIMES TXTHT/2 (PL EN (COND { (ATOM FORM) FORM) ((CAR FORM))))))) Y (FIX (DIVIDE (SUB RMARGIN EVAL-PPLEV LINE-SKIP) ) LEN1 (INDEX :ARRAY}) (AGTDSP BUFLOC NIL FULLMODE 1 :STACK) (DSP-EVAL BUFLOC LEN1) (REALWAIT SHORT-WAIT) (INDEX : ARRAY 1) (•GOTO MID (SUB Y ITSY-BITSY)) (*PLOT MID DWN) (•PLOT (ADD MID BARBSIZE) (ADD DWN BARBSIZE) ) {•GOTO (SUB MID BARBSIZE) (ADD DWN BARBSIZE) ) (•PLOT MID DWN) (•PLOT RGT DWN) (•PLOT RGT BOT) (*PLOT X BOT) (•PLOT X DWN) (*PLOT MID DWN) (•SYMBOL (ADD X EV-HT) (ADD BOT EV-*) 'EVAL EV-HT) (SETQ LEN2 (INDEX :ARRAY)) (DSP-EVAL (ADD BUFLOC LEN1 -1) LEN2) (SETQ LOCLIST (CONS (ADD BUFLOC LEN2 LEN1 -2) LOCLIST))) {•GOTO X Y) {•PLOT X Y) {•GOTO (ADD X BOXW/2) Y) (•PLOT (ADD X BOXW/2) Y) (•GOTO (ADD X BOXW) Y) (•PLOT (ADD X BOXW) Y) (SETQ LEN1 (INDEX :ARRAY) PPSIZE 0 MIDBOX (SUB (SUB Y ARRL) BOXH/2)) (DSP-EVAL BUFLOC LEN1) (SETQ LOCLIST (CONS (ADD BUFLOC LEN 1 -1) LOCLIST) } )•) )  X) TXTHT))  116  ;CALLED WHEN EVAL EXITS ;BLANKS OUT EVAL BLOCK, MOVES OB DISPLAYS RETURN VALUE, AND ; BOLLS I F NECESSABY ;IF WE WEBE NOT PREVIOUSLY DISPLAYING, UPDATE ALL VABIABLES (DEFUN DISPEV-EXIT {) (AGTDSP BUFLOC NIL FULLMODE 1 :STACK) (AND STAB-DONE LAST-STAR (AGTDSP LAST-STAB NIL FULLMODE 1 ;NORMAL) (SETQ LAST-STAB NIL)) (COND (8ETUBNS? (PBOG (L) (COND ( (EQ BETUBN-VALUE LAST—BETVAL) (MOVE-VAL X Y) (SETQ 1AST-RETVAL-X X LAST-RETVAL-Y Y) ) (T (WIPE-VAL) (AGTCON INT 0 BRIGHT :ARRAY D  (AGTCON SKIPZ 0 0 : ARRAY) (AGTCON INCR 0 0 : ARRAY) (AGTCON DX 0 0 : ARRAY) (AGTCON SKIPZ 0 0 : ARRAY) (AGTCON INCR 0 0 :ARRAY) (AGTCON DY 0 (TIMES DY-EVAL DY-DX-SCALE) :ARRAY) (AGTCVT 0 0 NIL NIL ; ARRAY) (PPD RETURN-VALUE (SETQ LAST-RETVAL-X X) (SETQ LAST-RETVAL-Y  117 flIOBOX)  VALOE-LENGTH VAR-PPLEV 0) (SETQ L (SOB1 (INDEX : ARRAY)) LAST-RETVAL RETURN-VALUE) (AND (LESSP L AGT-V ALOE-LENGTH) (AGTCON JUMPR (SOB AGT-VALOE-LENGTH L) 0 : ARRAY) ) (AGTDSP (ADD1 FWA-RETVAL) NIL FULLMODE (SUB1 (MIN (ADD 1 L) AGT-VALUE-LENGTH)) :ARRAY 2) (AGTDSP FWA-RETVAL NIL FULLMODE .1 ;ARRAY) (OR DISP? (DISP-ALL-VARS))))))) (COND ((AND (GREATERP DY-EVAL DONT-TOUCH) (GREATERP Y (ADD BOTTOM-EVAL ROLL-DIST))) (ROLL-EVAL (MINUS (MIN DY-EVAL ROLL-DIST))) (AGTCON JUMP (CAR (COND ((EQ DY-EVAL 0.) (LAST LOCLIST)) ( (NTH LOCLIST (MIN (LENGTH LOCLIST) (ADD1 NBLOCKS)))))) 0 :ARRAY 1) (AGTDSP JUMP-ROLL NIL FULLMODE 1 ;ARRAY)))) ;MOVE THE RETURN VALUE TO X Y. (DEFUN MOVE-VAL (X Y) (PROG (SECS NFRAMES DIST) (SETQ DIST (MAX (ABS (SUB X LAST-RETVAL-X) ) (ABS (SUB Y LAST-RETVAL-Y) ) ) SECS (DIVIDE DIST MOVE-RATE) NFRAMES (FIX (TIMES SECS FRAMES/SEC))) (COND ( (NEQ NFRAMES 0) (AGTCON SKIPZ NFRAMES 0 :TEMP 1) (AGTCON INCR 0 (TIMES DY-DX-SCALE (DIVIDE (SUB X  LAST-RETVAL NFRAMES) )  :TEMP) (AGTDSP (ADD 1 FWA-RETVAL) NIL FULLMODE 2 :TEMP) (AGTCON INCB 0 (TIMES DY-DX-SCALE (DIVIDE (SUB Y LAST-BETVAL NFRAMES)) :TEMP 2) (AGTDSP (ADD U FWA-RETVAL) NIL FULLMODE 2 :TEMP) (REALWAIT SECS) ) ) ) ) ;DISPLAY A LIST OF EVLIS VALUES (DEFUN DISP-EVLIS (VAL) (PROG (L) (COND {{EQ VAL LAST-BETVAL) (MOVE-VAL X EVLIS-Y))) (INDEX : ABBAY 1) (PPD VAL X EVLIS-Y EVLIS-PPLEN VAB-PPLEV 0) (SETQ EV-BIGHT (SUB "+X+" X) L {INDEX :ABBAY) EVLIS-Y (SUB EVLIS-Y LINE-SKIP)) (JUMP EVAL-BETURN) (AGTDSP (ADD1 (CAR EV-LOC)) NIL FULLMODE (SUB1 L) ;ARRAY 2) (WIPE-VAL) (AGTDSP (CAR EV-LOC) NIL FULLMODE 1 :ARRAY) (SETQ EV-LOC (CONS (ADD (CAR EV-LOC) L -1) (CDR EV-LOC)}) ) VAL) ;DISPLAY N OR FLAMBDA EVLIS (DEFUN DISP-NF (VAL) (AND DISP? EVLIS? EVLIS-MOVE? (PROG (EVLIS-Y) (SETQ EVLIS-Y {SUB Y (ADD LINE-SKIP EVAL-BLK-HT))  119 EV-LOC LOCLIST) (DISP-EVLIS VAL) (REALWAIT SHORT-WAIT) ) } VAL) ;TAKE CARE OE SPECIAL FORMS INTERSPERSED WITH FUNCTION ; DEFINITIONS ; (# (ENTRY-FORM) (FORM) (EXIT-FORM)) ; THIS IS A USER INSERTION. ENTRY-FORM IS EVALED (BY ; MTS LISP, NOT ; BY THE ANIMATION LISP) BEFORE FORM IS EVALED FOR ; ANIMATION. ; EXIT-FORM IS EVALED UPON EXIT. ; BOTH FORMS ARE INVISIBLE TO THE ANIMATION.. ; (* ADDR (FORM)) ; ADDR IS ADAGE LOCATION TO BE FILLED WITH AN ; INTENSIFY INSTRUCTION (DEFUN DO-SPECIALS () (COND ((AND (ATOM (CAR FORM)) (EQNAME (CAR FORM) USER-FORM)) (SETQ #TIMES (COND ((EQ (CAR FORM) USER-FORM) (RPLACA FORM (COPY USER-FORM) ) (SET (CAR FORM) (ADD1 EVAL-COUNTER)) 1) ( (LESSP (CAAR FORM) EVAL-COUNTER) (SET (CAR FORM) (ADD1 EVAL-COUNTER)) D  (T (SET (CAR FORM) (ADD 1 (CAAR FORM) ) ) (SUB (CAAR FORM) EVAL-COUNTER))))  (PROG (RET) (SETQ RET (EVAL (CADR FORM))) (OR (CDDR FORM) {RETURN RET «*EVAL))) (SETQ EXIT-FORM (CADDDR FORM) FORM (CADDR FORM) ) (DO-SPECIALS)) ({EQ (CAR FORM) STAR-FORM) (DO-STAR (CADR FORM) ) (SETQ FORM (CADDR FORM)) (DO-SPECIALS) ) ))  (DEFUN DO-STAR (ADDR) (AND LAST-STAR (AGTDSP LAST-STAR NIL FULLMODE 1 :NORMAL) ) (COND ((AND DISP? ADDR) (AGTDSP (SETQ STAR-DONE T LAST-STAR (ADD FWA-STAR ADDR)) NIL FULLMODE  120 1 :BRIGHT)) (T (SETQ LAST-STAR NIL) ) ) ) ;PROCESS EXCLUDED ATOMS AND FUNCTIONS (DEFUN DO-EXCLUDES () (COND ({AND (ATOM FORM) (MEMQ FORM EXCLUDE-ATOMS)) (RETURN (*VALUE FORM A '(ERRMSG UNDEFINED ATOM: (FORM))) '*EVAL)) {{AND {ATOM (CAR FORM)) (MEMQ (CAR FORM) EXCLUDE-FNS)) (SETQ DISP? NIL OLD-DISP? NIL)))) ;THIS ALLOWS FUNCTIONS WITH BREAKPOINTS TO BE EVALED BY MTS ; LISP FOR TESTING (DEFUN # FEXPR (L) (OR (CDR L) (PRINT '"WARNING-BREAKPOINT WITH ENTRY-FORM ONLY")) (EVAL {CADR L) ) ) ;THIS IS USED TO DISPLAY THINGS IN THE EXIT FORM (DEFUN #EXIT-DISP FEXPR (L) (INDEX :ARRAY 1) (EVLIS (CDR L) ) (DSP-EVAL BUFLOC (INDEX :ARRAY)) (REALWAIT (EVAL (CAR L))) ) ;MOVE FOLLOWER TO X, Y ;DISPLAY AT X, Y IF NOT ON ALREADY ;IT DOES NOT APPEAR UNTIL IT STARTS TO MOVE (DEFUN FOLLOW (X Y) (AND DISP? FOLLOW? (COND (FOLLOW-X (PROG (SECS NFRAMES DIST) (SETQ DIST (MAX (ABS (SUB X FOLLOW-X) ) (ABS  (SUB Y  FOLLOW-Y))) SECS (DIVIDE DIST FOLLOW-RATE) NFRAMES (FIX (TIMES SECS FRAMES/SEC))) (COND ( (NEQ NFRAMES 0) (AGTCON SKIPZ NFRAMES 0  121 : TEMP D  X  (AGTCON INCR 0 (TIMES DY-DX-SCALE (DIVIDE (SOB  FOLLOW-X) NFRAMES)) : TEMP) (ADD 1 FWA-FOLLOW) NIL FULLMODE 2 :TEMP) (AGTCON INCR 0 (TIMES DY-DX-SCALE (DIVIDE (SUB  (AGTDSP  Y FOLLOW-Y) NFRAMES))  : TEMP 2)  (AGTDSP  (ADD 4 FWA-FOLLOW) NIL FULLMODE 2 ; TEMP) (AGTDSP FWA-FOLLOW NIL FULLMODE 1 :BRIGHT) (REALWAIT SECS) ) ).) )  (AGTCON DY 0 (TIMES Y DY-DX-SCALE) :TEMP D  (AGTDSP  (ADD FWA-FOLLOW 6) NIL FULLMODE 1 : TEMP) (AGTCON DX 0 (TIMES X DY-DX-SCALE) :TEMP 1) (AGTDSP (ADD FWA-FOLLOW 3) NIL  FULLMODE 1 :TEMP) ) ) (SETQ FOLLOW-X X FOLLOW-Y Y)) ) ;TUSN OFF FOLLOWER (DEFUN FOLLOW-OFF () (AND FOLLOW? FOLLOW-X (AGTDSP FWA-FOLLOW NIL FULLMODE 1 :FOLLOW) (SETQ FOLLOW-X NIL)))  .************** ;  SHOW  - ************** ; (#SHOW S <X < Y » ) DISPLAY CONS CELLS OF S (DEFUN tSHOW FEXPR (F) (PROG (X Y) (SETQ X (OR (EVAL (CADR F) ) NEG-SCREEN-LIMIT) Y (OR (EVAL (CADDR F) ) (SUB SCREEN-LIMIT ATMHT))) (INDEX :ARRAY 1) (SHW1 (EVAL (CAR F) ) X Y) (DISPL) ) ) ; (#SHOWFN FN <X < Y » ) SHOW FUNCTION FN (DEFUN tSHOWFN FEXPR (L) (INDEX : ARRAY 1) (•INTENSITY BRIGHT) (AGTCVT 0 0 NIL NIL :ARRAY) (PROG (X Y) (SETQ X (OR (EVAL (CADR L)) NEG-SCREEN-LIMIT) Y (OR (EVAL (CADDR L) ) (SUB SCREEN-LIMIT TXTHT*2)}) (•SYMBOL X Y (MKATOM (FNAME (CAR L) ) •:) TXTHT) (•INTENSITY NORMAL) (SHW1 (GET (CAR L) • EXPR) X (SUB Y TXTHT^2)) (DISPL) ) ) (DEFUN SHW1 (F X Y) (PROG (FROMLIST-CAR TOLIST-CAR FROMLIST-CDR TOLIST-CDR DONELIST CAR-COUNT) (SETQ CAR-COUNT 0) (AND LOOPS? (LISTP F) (SCAN-LOOPS F)) (SHW F X Y) (DRAW-LOOPS FROMLIST-CAR TOLIST-CAR LOOPDEC) (DRAW-LOOPS FROMLIST-CDR TOLIST-CDR (ADD LOOPDEC SOMESPACE))))  ;LOOK FOR LOOPS IN SHOW DISPLAY (DEFUN SCAN-LOOPS (F) (AND (ATOM (CAR F) ) (EQNAME (CAR F) USER-FORM) (SETQ F (CADDR F) ) ) (SETQ DONELIST (CONS F DONELIST)) (COND ( (ATOM (CAR F) ) ) { (MEMQ (CAR F) DONELIST) (SETQ FROMLIST-CAR (CONS F FROMLIST—CAR)) (SETQ TOLIST-CAR (CONS (LIST (CAR F) ) TOLIST-CAR))) (T (SCAN-LOOPS (CAR F) ) ) ) (COND { (ATOM (CDR F) ) ) ( (MEMQ (CDR F) DONELIST) (SETQ FROMLIST—CDR (CONS F FROMLIST—CDR)) (SETQ TOLIST-CDR (CONS (LIST (CDR F) ) TOLIST-CDR)}) (T (SCAN-LOOPS (CDR F) )))•)• ;SAVE THE "TO" COORDINATES IN TOLIST (DEFUN DO-TOLIST (ENT) (AND (EQ F (CAR ENT) ) (RPLACD ENT (LIST X (ADD Y CONSIZE/2))))) ; DRAW ANY LOOPS IN THE SHOW DISPLAY (DEFUN DRAW-LOOPS (FROM TO LOOPDEC) (COND ((NULL FROM)) (T (PROG (A Y Y2 X2) (SETQ X (CADAR FROM) Y {CADDAR FROM) ) (*GOTO X Y) (•PLOT X (SETQ Y2 (ADD Y LOOPDEC) ) ) (SETQ X (CADAR TO)) (COND ((LESSP (CADDAR TO) Y) (SETQ X2 (SUB X CONSIZE) Y (ADD (CADDAR TO) CONSIZE/2) ) ) { (SETQ X2 (SUB X (SUB CONSIZE SOMESPACE) ) Y (SUB (CADDAR TO) CONSIZE/2) ) ) ) {•PLOT X2 Y2) (•PLOT X2 Y) {•PLOT X Y) {•PLOT (SUB X SHOW-BARBSIZE) (SUB Y SHOW-BARBSIZE) ) (•GOTO (SUB X SHOW-BARBSIZE) (ADD Y SHOW-BARBSIZE) ) (•PLOT X Y) (DRAW-LOOPS (CDR FROM) (CDR TO) LOOPDEC)))))  124 ;THIS DOES THE WORK RECURSIVELY. IT RETURNS (X Y) , THE ; DIMENSIONS OF THE DISPLAY CREATED (DEFUN SHW (F X Y) (COND ( (AND (ATOM (CAAR F) ) (EQNAME (CAAR F) USER-FORM)) (COND ( (CDDAR F) (SETQ F (CONS (CADDAR F) (CDR F) )) ) {(SETQ F (CDR F ) ) ) ) ) ) (COND ((AND (NULL F) (NOT SHOWNIL?) ) • (0. 0.),) ((OR (MAPC VDO-TOLIST TOLIST-CAR) (MAPC 'DO-TOLIST TOLIST-CDR))) ((OR (GREATERP (ADD X MINCONSWIDTH) X^-LIMIT) (LESSP (ADD Y YDEC) Y-LIMIT) ) (OFFSCREEN) ) ( (ATOM F) (DISPATM (COND ((MINUSP CAR-COUNT) (FNAME F) ) (F)) *))  {T {PROG (SIZEA SIZED XD TEMP 1 TEMP2) (SETQ CAR-COUNT (SUB1 CAR-COUNT) SIZEA (COND ({CAR F) (COND ({SETQ TEMPI (MEMQ F FROMLIST-CAR)) TEMPI)  (RPLACA TEMPI (LIST (CAR (ADD  X CONSIZE/2)  Y)) ( 0 - 0.)) (T (SHH (CAR F) X (ADD Y 1  YDEC))))) (T (DISPATM (CAR F) (ADD Y YDEC) ) ) ) ) (COND (TEMP 1 (CONSBOX) ) ( (DISPCONS) ) ) (SETQ XD (COND ( (LISTP (CDR F) ) {ADD X (CAR SIZEA) ) ) {(ADD X MINCONSWIDTH)) ) ) (SETQ CAR-COUNT 1 SIZED (COND ( (AND (CDR F) (SETQ TEMP2 (MEMQ F FROMLIST-CDR))) (RPLACA TEMP2 (LIST (CAR TEMP2) (ADD CONSIZE CONSIZE/2  125 . Y) )  X)  ' (0. 0.)) (T (SHW (CDR F) XD Y)))) (OR TEMP2 (RABROW  (LIST  (COND ( (EQ (CAR SIZED) 0) (ADD X MINCONSWIDTH)) (XD)))) (MAX (CAR SIZEA) (SUB (ADD XD (CAR SIZED) ) X)) (MAX (ADD YDEC (CADR SIZEA) ) (CADR SIZED)))))))  ;DISPLAY AN ATOM (DEFUN DISPATM (F Y) (COND (DETAILATOM? (CONSBOX) (•SYMBOL (ADD X CONSIZE*2 SOMESPACE) Y F ATMHT) (COND ( (EQ F (CAR F)) (•GOTO DWNt Y) (•PLOT DWN# (SUB Y CONSIZE) ) (COND ( (EQ F (CDR F) ) (•GOTO (ADD DWNt CONSIZE) Y) (•PLOT (ADD DWNt CONSIZE) (SUB Y CONSIZE)) (•PLOT DWN# (SUB Y CONSIZE) ) (•PLOT (ADD DWNt SHOW-BARBSIZE) (ADD (SUB Y CONSIZE) SHOW-BARBSIZE) ) (•GOTO (ADD DWNt SHOW-BARBSIZE) (SUB (SUB Y CONSIZE) SHOW-BARBSIZE)) (•PLOT DWNt (SUB Y CONSIZE)))) (•PLOT (SUB DWNt CONSIZE) (SUB Y CONSIZE) )  (•PLOT (SUB DWNt CON SIZE) *) (•PLOT X Y) {•PLOT (SOB X SHOW-•BARBSIZE) (SUB Y SHOW-•BARBSIZE) ) (•GOTO (SUB X SHOW-•BARBSIZE) (ADD Y SHOW-BARBSIZE) ) (*PLOT X Y))) (LIST (ADD CONSIZE*2 (TIMES (PLEN F) ATMHT) ) ATMHT) ) (T (•SYMBOL (ADD X SOMESPACE) Y F ATMHT) (LIST (MAX MINCONSWIDTH (TIMES ATMHT (PLEN F) ) ) ATMHT)))) ;DISPLAY A CONS CELL (DEFUN DISPCONS () (CONSBOX) (*GOTO DHN# Y) (•PLOT D»N# BOTt) (•PLOT (SUB D»N# SHOW-BARBSIZE) (ADD BOT# SHOW-BARBSIZE)) (•GOTO (ADD DWN# SHOW-BARBSIZE) (ADD BOTt SHOW-BARBSIZE) ) (•PLOT DWNt BOTt)) (DEFUN CONSBOX () (SETQ TOPt (ADD Y CONSIZE) MIDt (ADD X CONSIZE) RIGHTt (ADD X CONSIZE^2) DSN# (ADD X CONSIZE/2) BOTt (ADD Y YDEC CONSIZE) ) (•GOTO X Y) (•PLOT X TOPt) (•PLOT RIGHTt TOPt) {•PLOT RIGHTt Y) (•PLOT X Y) (•GOTO MID# TOPt) (•PLOT MID# Y) ) ;DRAW AN ARROW TO RIGHT AND SLASH CONS BOXES I F CDR=NIL (DEFUN RARROW (RIGHT) (COND ({OR SHOWNIL? (CDR F) ) (SETQ MID (ADD Y CONSIZE/2)) (•GOTO (ADD X CONSIZE^2) MID) {•PLOT RIGHT MID) (•PLOT (SUB RIGHT SHOW-BARBSIZE) (ADD MID SHOW-BARBSIZE) ) (•GOTO (SUB RIGHT SHOW-BARBSIZE)  (SOB MID SHOW-BARBSIZE) ) (*PLOT RIGHT HID) ) (T (*GOTO (ADD X CONSIZE) Y) (*PLOT (ADD X CONSIZE*2) (ADD Y CONSIZE))))) ;IF SIZEA=NIL WE RAN OFF BOTTOM (CAR) OTHERWISE OFF RIGHT (DEFUN OFFSCREEN () (COND (CONTINOE? (PPD F X Y (FIX (DIVIDE (SOB SCREEN-LIMIT X) ATMHT)) 5 LINE-SKIP) } ) «(0. 0.1)  - *********************** ;  PRETIYPRINTER  .***********************  ; PPD RETURNS THE # OF LINES DISPLAYED ;IF LINE-SKIP IS 0, ONLY ONE LINE WILL BE PRINTED (DEFUN PPD (FORM PX PY MAXWIDTH LEVEL LINE-SKIP) (PROG (*PLEN TEST-FLAG " + Y+" +SIZE+»' Y-DEC SINGLE-FLAG) (SETQ *PLEN 0 "+X+" PX "+Y+" PY) (SETQ Y-DEC LINE-SKIP "+SIZE+" (TIMES TXTHT 0.857}) (*PPFORM1 FORM LEVEL) (*TERPRI*) (ABS (DIVIDE (SUB "+Y+" PY) (COND ({EQ Y-DEC 0) 1) (Y-DEC)))))) ,,  (DEFUN *PPF0RM1 (FORM LEV) (SETQ LEV (SUB1 LEV) ) (COND { (ATOM FORM) (WR FORM)) ( (LESSP LEV 1) (WR •&) ) ((AND SHORTQUOTE (EQ (CAR FORM) 'QUOTE)} (WR '»*") (*PPF0RM1 (CADR FORM) LEV)) ( (AND (ATOM (CAR FORM) ) (EQNAME (CAR FORM) USER-FORM) ) (AND (CDDR FORM) (*PPFORM 1 (CADDR FORM) LEV))) ((EQ (CAR FORM) STAR-FOfiM) (SET-STAR FORM * (*PPF0RH1 (CADDR FORM) LEV))) ( (AND (OR (LESSP LEV 2) (NOT (HEHQ (CAR FORK) (COND DEFUN)))) (*PPFIT FORM))) ({*PPSPECIAL FORM)) ({PROG (CARFORM TAB) (SETQ CARFORM (UNCONS FORM FORM)) (WR "(»») 1  (COND ( (ATOM CARFORM) (WB (FNAME CABFOEM)) (•SKIP* 1) (SETQ TAB (ADD1 *PLEN)) (COND ((LISTP FOBM) (*PPF0BM1 (ONCONS FOBM FOBM) LEV) ) (FOBM (WB ".") (*SKIP* 1) (WB FOBM) (SETQ FOBM NIL)) (T (*SKIP* -1)))) (T (SETQ TAB (PLUS 2 *PLEN) ) (*PPFOBM1 CABFOBM LEV))) (MAPC ' (LAMBDA (CABFOEM) (*TEBPBI*) (•TAB* TAB) (*PPF0RM1 CABFOBM LEV) ) FOBM) (AND (CDE (LAST FOBM) ) (*SKIP* 1) (WE ".") (*SKIP* 1) (WB (CDE (LAST. FOBM) ) ) ) (MB »)»))))) (DEFUN *PPFIT (FOBM) (COND ( (GEEATEBP MAXWIBTB (PLUS *PLEN (TESTLEN FOBM PX PY 0 T ) ) ) (•PRIN1* FOBM LEV) T))) (DEFUN *PPSPECIAL (FOBM) (COND ({AND (ATOM (CAB FOEM) ) (NOT (NUMBEBP (CAR FOEM)))) (APPLY 1 (GET (CAB FORM) '*PPSPECIAL * (RETURN NIL •*PPSPECIAL)) FORM) T))) {DEFUN *PPPBOG (FOBM) (WE » (") (WE (UNCONS FOBM FOBM) ) (•SKIP* 1) (PEOG (TAB VABS) (SETQ TAB (ADD 1 *PLEN)) (COND ({*PPFIT (CAB FOBM))) (T (SETQ VABS (CAR FORM)) (WE " (") (*PRIN1* (CAB VABS) LEV) (MAPC • (LAMBDA (CAEFORM)  (•SKIP* 1) (COND ( (*PPFIT CABFOBM) ) (T (*TERPBI*) (*TAB* TAB) (*PBIN1* CABFOBM LEV) ) ) ) (CDB VABS)) (WE «)«))) (MAPC '(LAMBDA (FOBM) (*TEBPRI*) (•TAB^ TAB) (COND ((ATOM FOBM) (•SKIP+ -2) (WB FOBM)) ((•PPFOEM1 FORM LEV)))) (CDB FOBM) ) (WB " ) " ) ) ) (DEFUN •PPSETQ (FOBM) (WB "(") (WB (CAB FOBM) ) (•SKIP^ 1) (PBOG (TAB SW) (SETQ TAB (ADD1 •PLEN) SW T FOBM (CDB FOEM)) (BEPEAT • (PBOGN (OB SW (•TEBPBI^) (•TAB^ TAB)) (•PPFOBM1 (CAE FOBM) LEV) (•SKIP^ 1) (•PPFOBM1 (CADE FOBM) LEV) (SETQ FOBM (CDDR FOBM) SW NIL)) (SHIFT (LENGTH FOEM) -1))) (WB ") ») ) (DEFUN •PPDEFUN (FOBM) (WB " (") (WE (UNCONS FOBM FOEM) ) (•SKIP^ 1) (WB (FNAME (UNCONS FOBM FOBM))) (•SKIP^ 1) (COND ( (MEMQ (CAB FOBM) > (EXPB FEXPE NEXPB)) (WB (UNCONS FOBM FOBM)) {•SKIP^ 1))) (PBOG (VABS) (SETQ VABS (UNCONS FOBM FOBM)) (COND (VABS (•PPFOEM1 VAES LEV) ) {(WE {)»)))) (MAPC • (LAMBDA (CAEFOBM) (•TEEPEI^) {•TAB* 3) (•PPFOBM1 CABFOBM LEV)) FOBM) (WB ") ") ) (DEFPEOP DEFUN •PPSPECIAL *PPDEFUN)  (DEFPROP PROG *PPSPECIAL •PPPROG) (DEFPROP  (SETQ SET) •PPSPECIAL •PPSETQ)  (DEFUN *TAB* (N) (OR SINGLE-FLAG (SETQ "+X + " (ADD PX (TIMES (SOB1 N) "+SIZE+")) •PLEN (MAX (SUB1 N) *PLEN) ) ) ) (DEFUN *TERPRI^ () (COND ({EQ 0 LINE-SKIP) (SETQ SINGLE-FLAG T)) (T (SETQ •PLEN 0 "+X+" PX "+¥+" (SUB "+Y + " Y-DEC)))) NIL) (DEFUN *SKIP^ (N) (AND (GREATERP N 0 ) (SETQ BLANK "+X+") ) (SETQ "+X+" (ADD "+X+" (TIMES N "+SIZE+")) •PLEN (ADD •PLEN N))) (DEFUN TESTLEN (F +X+ +Y+ •PLEN TEST-FLAG) (•PRIN1^ F LEV) •PLEN) (DEFUN *PRIH1* (F LEV) (COND ((ATOM F) (WR F) ) ((AND (ATOM (CAR F) ) (EQNAME (CAR F) USER-FORM)) (AND (CDDR F) (*PRIN1* (CADDR F) LEV) ) ) {(EQ (CAR F) STAR-FORM) (SET-STAR F ' (*PRIN1* (CADDR F) LEV))) ((AND SHORTQUOTE (EQ (CAR F) 'QUOTE)) (WR "««) (•PRIN1+ (CADR F) (SUB 1 LEV))) ( (LESSP LEV 1) (WR '&) ) ( (AND (ATOM (CAR F) ) (GET (CAR F) 'ALIAS)) (WR " («) (WR (FNAME (CAR F) ) ) (AND (CDR F) (•SKIP^ 1) {•PRIN2 (CDR F)) ) (WR ") ") ) (T (WR "(") (*PRIN2 F) (WR " ) " ) ) ) ) (DEFUN •PRIN2 (F) (COND ({NULL F) ) ((NULL (CDR F) ) (•PRINI* {CAR F) (SUB1 LEV))) ( (ATOM (CDR F)) {•PAIN1* (CAR F) (SUB 1 LEV)) (•SKIP+ 1)  131 (MS ".») (•SKIP* 1) (*PRIN1* (CDS F) (SUB1 LEV))) (T (*PRIN1* (CAR F) (SUB1 LEV)) (*SKIP* 1) (*PRIN2 (CDR F) ) ) ) ) ;WRITE AN ATOM ON THE SCREEN (DEFUN WR (F) (COND ( (NOT TEST-FLAG) (AND SINGLE-FLAG (SETQ F •" ..."}) (AND (NUMBERP F) (SETQ F (MKATOM F) ) ) (AGTEXT "+X + " "+Y + " "+SIZE+" F : ARRAY) (AND SINGLE-FLAG (RETURN 1 *PPD)))) (SETQ *PLEN (ADD *PLEN (PLEN F) ) " + X + " (ADD "+X + (TIMES "+SIZE+" (PLEN F) ) ) ) ) M  ;PLACE ADAGE ADDR IN STAR-FORM AND INSERT INTENSIFY INSTRUCTION (DEFUN SET-STAR (FRM EXP) (COND {{AND (NOT TEST-FLAG) STAR-FLAG) (SETQ LAST-INTS T) (RPLACA (CDR FRM) (SUB 1 (INDEX : ARRAY) ) ) (•INTENSITY NORMAL) (EVAL EXP) (COND (LAST-INTS (*INTENSITY NORMAL) (SETQ LAST-INTS NIL)})) (T (EVAL EXP))))  .********************* ; GRAPHICS PRIMITIVES .********************* (DEFUN #DISP FEXPR (L) (INDEX : ARRAY 1) (EVLIS L) (DISPL) ) (DEFUN *PLOT (X Y) (AGTCVT X Y T NIL : ARRAY) ) (DEFUN *JUMP NEXPR (LABEL) {PROG (L) (SETQ L (COND ( (ASSQ LABEL LABELS)) (T (SETQ LABELS (CONS (LIST LABEL NIL) LABELS) ) (CAR LABELS)))) (NCONC L (LIST (CONS JUMPR (INDEX :ARRAY (ADD1 (INDEX :ARRAY)))))}))  i  132 (DEFUN JUMP (N) (AGTCON JUMP N 0 : ARRAY)) (DEFUN *GOTO (X Y) (AGTCVT X Y NIL NIL  :ARRAY))  (DEFUN *SKIPNZ (COUNT) (AGTCON SKIPNZ COUNT 0 :ARRAY)) (DEFUN *SKIPZ (COUNT) (AGTCON SKIPZ COUNT 0 :ABBAY)) (DEFUN *SYHBOL (X Y STBING SIZE) (AND (NUMBEBP STRING) (SETQ STBING (AGTEXT X Y SIZE STBING : ABB AY) )  (J3KATOH STBING)))  (DEFUN *INTENSITY (V) (AGTCON INT 0 V :ARRAY)) (DEFUN *DASH () (AGTCON DASH 0 0 : ARBAY) ) (DEFUN *UNDASH () (AGTCON UNDASH 0 0 : ABBAY)) (DEFUN FOB FEXPR (L) (GPROG (*SKIPNZ (FIX (TIMES FRAMES/SEC (EVAL (CAR 1) } ) ) ) (*JUMP OUT) (EVLIS (CDR L)) OUT) ) ;THIS ACCEPTS A GLISP SUBROUTINE AND DISPLAYS IT (DEFUN SUBROUTINE FEXPR (L) (INDEX :ARBAY 1) (AGTCON SCALE 0 GLISP-SCALE :ARRAY) (SETQ SUBROUTINE? T) (EVLIS (CDR L) ) (SETQ SUBROUTINE? NIL) (AGTCON SCALE 0 *SCALE : ABBAY) (DISPL) )  IMMEDIATELY  ;THIS IS SIMILAB TO GLISP ADJ EXCEPT THAT DIALS ABE NOT ALLOWED (DEFUN ADJ FEXPB (L) (OB FADE? (AGTCON INT 0  (TIMES (EVAL (CADDAR L) ) 0.1) : ARRAY) ) (AGTCON DX 0 (TIMES (EVAL (CAAR L)) 0.1) :ARRAY) (AGTCON DY 0 (TIMES (EVAL (CADAR L)) 0.1) :ARRAY) (AGTCON SCALE 0 (TIMES (EVAL (CAR (CDDDAR L))) 0.1) : ARRAY) (EVLIS (CDR L)) (OR FADE? (AGTCON INT 0 NORMAL :ARRAY)) (AGTCON DX 0 0 : ARRAY) (AGTCON DY 0 0 : ARRAY) (AGTCON SCALE 0 (COND (SUBROUTINE? GLISP-SCALE) (•SCALE) ) :ARRAY) ) ;DRAM THE VECTORS GENERATED BY PRIMITIVES ONE AT A TIME (DEFUN #DRAW FEXPR (L) (AGTCON SCALE 0 GLISP-SCALE :ARRAY 1) (EVLIS (CDR L) ) (AGTCON SCALE 0 *SCALE :ARRAY) (AGTCVT 0 0 NIL T :ARRAY) (PROG (Z N LIM) (SETQ Z 1 LIM (INDEX :ARRAY) N (FIX (EVAL (CAR L) ) ) ) (COND ( (GREATERP N 0) (PROG NIL LOOP (AGTDSP FREE NIL FULLMODE 1 :ARRAY Z) (RTHAIT N) (SETQ FREE (ADD1 FREE) Z (ADD 1 Z)) (AND (LESSP Z LIM) (GO LOOP)))) (T (PROG NIL (SETQ N (MAX 1 (ABS N) ) ) LOOP (AGTDSP FREE NIL FULLMODE N :ARRAY Z) (SETQ FREE (ADD N FREE) Z (ADD N Z) ) (AND (LESSP Z LIM) (GO LOOP))))))) (DEFUN GPROG FEXPR  (GPROG)  134 (PROG (LABELS) (HAPC •(LAMBDA  (GPROG) (COND { (ATOM GPROG) (LABL GPROG)) ( (EVAL GPROG) ) ) ) GPROG) i (RESOLVELABELS) ) )  {DEFUN RESOLVELABELS () (PROG (LOC SAVEINDEX REFS) (SETQ SAVEINDEX (INDEX :ARRAY)) (MAPC » (LAMBDA (L) (COND ((SETQ LOC (CADR L) ) (MAPC • (LAMBDA (REF) (AGTCON REF) )  REF) ) )  (CAR REF) (SOB LOC (CDR 0 :ARRAY (CDR  (CDDR L) ) ) (T (ERRMSSG "UNKNOWN LABEL" ((CAR L ) ) ) (RETURN NIL})))  LABELS) (INDEX :ARRAY SAVEINDEX)) )  (DEFUN LABL (LABEL) (PROG (L) (SETQ L (COND ( (ASSQ LABEL LABELS)) (T {SETQ LABELS (CONS (LIST LABEL NIL) LABELS)) (CAR LABELS)})) (AND (CADR L) (PROGN (ERRMSSG (LABEL) "IS MULTIPLY DEFINED") {RETURN NIL) )•) (RPLACA (CDR L) (INDEX :ARRAY) ) ) ) (SETQ LABELS NIL) ; (FADE HOLDTIME FADETIME DISPLAY-CODE) (DEFUN FADE FEXPR (L) (SETQ FADEFRAMES (FIX (TIMES FRAMES/SEC (EVAL (CADR L ) ) ) ) HOLDFRAMES (FIX (TIMES FRAMES/SEC (EVAL (CAR L) ) ) ) ) (GPROG (*SKIPNZ (ADD FADEFRAMES HOLDFRAMES)) (*JUMP OUT) (*SKIPNZ HOLDFRAMES)  (AGTCON INCH 0 (MINUS (DIVIDE NORMAL FADEFRAMES) ) : ARRAY) (•INTENSITY NORMAL) (SETQ FADE? T) (EVLIS (CDDR L)) (SETQ FADE? NIL) (•INTENSITY NORMAL) OUT) ) (DEFUN ERRMSG FEXPR #L# (TERPRI) (PRIN1 '•••ERROR:) (MESSAGE) (TERPRI) (AND EVALING? (PRIN1 'FORM:) (PRIN1 FORM) (TERPRI))) (DEFUN MSSG FEXPR #L# (TERPRI) (MESSAGE) (TERPRI) ) (DEFUN MESSAGE () (MAPC « (LAMBDA (#X#) (COND ((EQ #X# ':) (TERPRI) (TAB 5)) ((ATOM #X#) (PRIN 1 #X#) ) ( (MAPC • (LAMBDA (#X#) (PRIN1 (EVAL #X#))) #X#)))) (ARG 1))) (AND ATAGT? (#START))  136 PRINT OFF SCONTINUE WITH LISP:LISPSTART RETURN PRINT ON *LISP MACROS WERE READ IN ABOVE BUT NOT PRINTED  * *  IFADG  IFADG  CSECT BALR 8,0 USING *,8 STM 13,6,SAVE CALL GUINFO, (C74,RNAM) LM 13,6,SAVE LR PDS,D LR A,NILE L 9,RNAM GET THE DEVICE NAME C 9,ADAGE SEE I F DS27 BNE OUT RETURN NIL I F NOT L A,TRUEATOM RETURN T—DEFINED IN LISP MACROS BR RET DC C * DS27 * 6F DS ROOM FOR NAME AND USER COMMENT t 741 DC CODE FOR DEVICE NAME DS 10F REGISTER SAVE AREA END  OUT ADAGE RNAM C1H SAVE  RETURN T IF AT THE ADAGE, NIL OTHERWISE  F  

Cite

Citation Scheme:

        

Citations by CSL (citeproc-js)

Usage Statistics

Share

Embed

Customize your widget with the following options, then copy and paste the code below into the HTML of your page to embed this item in your website.
                        
                            <div id="ubcOpenCollectionsWidgetDisplay">
                            <script id="ubcOpenCollectionsWidget"
                            src="{[{embed.src}]}"
                            data-item="{[{embed.item}]}"
                            data-collection="{[{embed.collection}]}"
                            data-metadata="{[{embed.showMetadata}]}"
                            data-width="{[{embed.width}]}"
                            async >
                            </script>
                            </div>
                        
                    
IIIF logo Our image viewer uses the IIIF 2.0 standard. To load this item in other compatible viewers, use this url:
http://iiif.library.ubc.ca/presentation/dsp.831.1-0051764/manifest

Comment

Related Items