Chapters 11 & 12 Interation and Structures - putting LISP into overdrive. ============================ No questions, one comment for week 7 ============================ comment: I've gained the introduction of Lisp intended and will be committing less time to it's study at this time heretoforwith (starting tomorrow). Let me take this opportunity to thank you, jgw, for presenting this course on Lisp, taking the time to go through Tourtezky's book to gleen introductory material and availability answering questions about Lisp online. It seems like you're pioneering an interesting educational approach using the online text mode (com). Answers ============================== 11.4 (defun it-length (x) (dotimes (i x (format t "~& unit ~S" x)))) Three parameters are used in the dotimes and dolist examples while description on shows two. 11.5 (defun IT-NTH (i x) (dolist (i x (cdr x)))) In section 11.7, pg 347, Tourteszky defines the DO function as follows: (DO ((var1 init1 [update1]) (var2 init2 [update2]) ...) (test action-1 ... action-n) body) First read through. What does 'init' stand for? I assume it stands for 'initialize'. In the paragraph, below his definition in the book (pg 347) he describes the DO function. What does he mean by 'termination actions? He uses it as follows: "If the result is true, DO evalutes the termination actions ..." Are the the [update1] and [update2] elements termination actions? Again, referring to Tourtezky's definition, is '(test action-1 ... action-n)' part of the body of the DO function? What is a FORM? pg 348 "...the terminatin test is tried again,and if it is true, DO evaluates the termination actions. Otherwise it goes on to evaluate the body again." Q: Does this mean DO has to keep going until it evaluates something that is T? Are we talkin forever loop again? 11.12 (defun power-of-2 (n x) (do ((base n (incf base base)))((< x (format t "n is ~S base is ~S" n base ))))) 11.16 LET assigns, DO iterates. page 367 section 12.3 Defining Structures "...componets are called NAME, SPEED, CONDTION, and SHIELDS. STARSHIP becomes part of the system type hierarchy and can be referenced by such functions as TYPE and TYPE-OF," How? 12.1 CAPTAIN component :CAPTAIN call to component STARSHIP-CAPTAIN symbol or handle 12.2 Yes it is T.