changeset 47322:8a11a2109567

(doctor-cadr, doctor-caddr, doctor-cddr): Remove. Update callers.
author John Paul Wallington <jpw@pobox.com>
date Mon, 09 Sep 2002 05:50:58 +0000
parents 54efbd9f8cab
children ff0c55c69b84
files lisp/ChangeLog lisp/play/doctor.el
diffstat 2 files changed, 31 insertions(+), 30 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Mon Sep 09 01:43:31 2002 +0000
+++ b/lisp/ChangeLog	Mon Sep 09 05:50:58 2002 +0000
@@ -1,3 +1,8 @@
+2002-09-09  John Paul Wallington  <jpw@shootybangbang.com>
+
+	* play/doctor.el (doctor-cadr, doctor-caddr, doctor-cddr): Remove.
+	Update callers.
+	
 2002-09-08  Markus Rost  <rost@math.ohio-state.edu>
 
 	* diff.el (diff): Doc fix.
--- a/lisp/play/doctor.el	Mon Sep 09 01:43:31 2002 +0000
+++ b/lisp/play/doctor.el	Mon Sep 09 05:50:58 2002 +0000
@@ -45,10 +45,6 @@
 
 ;;; Code:
 
-(defun doctor-cadr (x) (car (cdr x)))
-(defun doctor-caddr (x) (car (cdr (cdr x))))
-(defun doctor-cddr (x) (cdr (cdr x)))
-
 (defun // (x) x)
 
 (defmacro $ (what)
@@ -91,8 +87,8 @@
   (make-local-variable 'typos)
   (setq typos
 	(mapcar (function (lambda (x)
-			    (put (car x) 'doctor-correction  (doctor-cadr x))
-			    (put (doctor-cadr x) 'doctor-expansion (doctor-caddr x))
+			    (put (car x) 'doctor-correction  (cadr x))
+			    (put (cadr x) 'doctor-expansion (car (cddr x)))
 			    (car x)))
 		'((theyll they\'ll (they will))
 		  (theyre they\'re (they are))
@@ -892,11 +888,11 @@
 		    bye\, stop pause goodbye\, stop pause)))
     (doctor-type ($ bye)))
    ((and (eq (car sent) 'you)
-	 (memq (doctor-cadr sent) abusewords))
-    (setq found (doctor-cadr sent))
+	 (memq (cadr sent) abusewords))
+    (setq found (cadr sent))
     (doctor-type ($ abuselst)))
    ((eq (car sent) 'whatmeans)
-    (doctor-def (doctor-cadr sent)))
+    (doctor-def (cadr sent)))
    ((equal sent '(parse))
     (doctor-type (list  'subj '= subj ",  "
 			'verb '= verb "\n"
@@ -912,7 +908,7 @@
    ((memq (car sent) '(do has have how when where who why))
     (doctor-type ($ qlist)))
    ;;   ((eq (car sent) 'forget)
-   ;;    (set (doctor-cadr sent) nil)
+   ;;    (set (cadr sent) nil)
    ;;    (doctor-type '(($ isee)($ please)
    ;;     ($ continue)\.)))
    (t
@@ -931,7 +927,7 @@
 	   (if (memq 'am sent)
 	       (setq sent (doctor-replace sent '((me . (i))))))
 	   (setq sent (doctor-fixup sent))
-	   (if (and (eq (car sent) 'do) (eq (doctor-cadr sent) 'not))
+	   (if (and (eq (car sent) 'do) (eq (cadr sent) 'not))
 	       (cond ((zerop (random 3))
 		      (doctor-type '(are you ($ afraidof) that \?)))
 		     ((zerop (random 2))
@@ -940,7 +936,7 @@
 		      (doctor-rthing))
 		     (t
 		      (doctor-type '(($ whysay) that i shouldn\'t
-				     (doctor-cddr sent)
+				     (cddr sent)
 				     \?))))
 	     (doctor-go (doctor-wherego sent))))))))
 
@@ -1138,13 +1134,13 @@
 (defun doctor-setprep (sent key)
   (let ((val)
 	(foo (memq key sent)))
-    (cond ((doctor-prepp (doctor-cadr foo))
-	   (setq val (doctor-getnoun (doctor-cddr foo)))
+    (cond ((doctor-prepp (cadr foo))
+	   (setq val (doctor-getnoun (cddr foo)))
 	   (cond (val val)
 		 (t 'something)))
-	  ((doctor-articlep (doctor-cadr foo))
-	   (setq val (doctor-getnoun (doctor-cddr foo)))
-	   (cond (val (doctor-build (doctor-build (doctor-cadr foo) " ") val))
+	  ((doctor-articlep (cadr foo))
+	   (setq val (doctor-getnoun (cddr foo)))
+	   (cond (val (doctor-build (doctor-build (cadr foo) " ") val))
 		 (t 'something)))
 	  (t 'something))))
 
@@ -1275,33 +1271,33 @@
   (let ((foo sent))
     (while foo
       (if (and (eq (car foo) 'me)
-	       (doctor-verbp (doctor-cadr foo)))
+	       (doctor-verbp (cadr foo)))
 	  (rplaca foo 'i)
 	(cond ((eq (car foo) 'you)
-	       (cond ((memq (doctor-cadr foo) '(am be been is))
+	       (cond ((memq (cadr foo) '(am be been is))
 		      (rplaca (cdr foo) 'are))
-		     ((memq (doctor-cadr foo) '(has))
+		     ((memq (cadr foo) '(has))
 		      (rplaca (cdr foo) 'have))
-		     ((memq (doctor-cadr foo) '(was))
+		     ((memq (cadr foo) '(was))
 		      (rplaca (cdr foo) 'were))))
 	      ((equal (car foo) 'i)
-	       (cond ((memq (doctor-cadr foo) '(are is be been))
+	       (cond ((memq (cadr foo) '(are is be been))
 		      (rplaca (cdr foo) 'am))
-		     ((memq (doctor-cadr foo) '(were))
+		     ((memq (cadr foo) '(were))
 		      (rplaca (cdr foo) 'was))
-		     ((memq (doctor-cadr foo) '(has))
+		     ((memq (cadr foo) '(has))
 		      (rplaca (cdr foo) 'have))))
 	      ((and (doctor-verbp (car foo))
-		    (eq (doctor-cadr foo) 'i)
-		    (not (doctor-verbp (car (doctor-cddr foo)))))
+		    (eq (cadr foo) 'i)
+		    (not (doctor-verbp (car (cddr foo)))))
 	       (rplaca (cdr foo) 'me))
 	      ((and (eq (car foo) 'a)
 		    (doctor-vowelp (string-to-char
-				    (doctor-make-string (doctor-cadr foo)))))
+				    (doctor-make-string (cadr foo)))))
 	       (rplaca foo 'an))
 	      ((and (eq (car foo) 'an)
 		    (not (doctor-vowelp (string-to-char
-					 (doctor-make-string (doctor-cadr foo))))))
+					 (doctor-make-string (cadr foo))))))
 	       (rplaca foo 'a)))
 	(setq foo (cdr foo))))
     sent))
@@ -1494,12 +1490,12 @@
   (let ((foo (memq found sent)))
     (cond ((< (length foo) 2)
 	   (doctor-go (doctor-build (doctor-meaning found) 1)))
-	  ((memq (doctor-cadr foo) '(a an))
+	  ((memq (cadr foo) '(a an))
 	   (rplacd foo (append '(to have) (cdr foo)))
 	   (doctor-svo sent found 1 nil)
 	   (doctor-remember (list subj 'would 'like obj))
 	   (doctor-type ($ whywant)))
-	  ((not (eq (doctor-cadr foo) 'to))
+	  ((not (eq (cadr foo) 'to))
 	   (doctor-go (doctor-build (doctor-meaning found) 1)))
 	  (t
 	   (doctor-svo sent found 1 nil)